>=
35 | q.set.print$empty <- c("\\rule[-27mm]{0mm}{54mm}") # creates empty column with a white height line to make sure rows have some height
36 | print.xtable(
37 | xtable(
38 | x = q.set.print[c("id","empty","full wording")],
39 | type = "latex",
40 | align = c(
41 | "m{0mm}", # this is just for the rownames, isn't actually printed
42 | "H{72mm}", # this is for the hash or id, must be a little shorter to fit
43 | "m{0mm}", # empty column in the middle with stretcher vertical line, width is given by colsep in the above (no need for extra width here) - this adds up to 1cm anyway
44 | "m{75mm}" # the real deal with the full item
45 | )
46 | ), # smaller than cards for margin,
47 | tabular.environment = "longtable",
48 | latex.environment = "center",
49 | table.placement = "p",
50 | floating = FALSE,
51 | include.rownames = FALSE,
52 | include.colnames = FALSE,
53 | comment = FALSE,
54 | #if(!is.null(wording.font.size)) {
55 | # paste(size = wording.font.size)
56 | #}
57 | size = wording.font.size,
58 | sanitize.text.function = identity,
59 | hline.after = NULL
60 | )
61 | @
62 | \end{document}
63 |
--------------------------------------------------------------------------------
/inst/extdata/importexample/feedback/after/JohnDoe.csv:
--------------------------------------------------------------------------------
1 | item_id,item_feedback,correction
2 | i01,"I don't like Asterix and Obelix",FALSE
3 | i02,"There is a typo here!",TRUE
4 |
--------------------------------------------------------------------------------
/inst/extdata/importexample/qsorts/after/JaneDoe.csv:
--------------------------------------------------------------------------------
1 | ,i01,
2 | i02,i03,i04
3 | -1,0,1
--------------------------------------------------------------------------------
/inst/extdata/importexample/qsorts/after/JohnDoe.csv:
--------------------------------------------------------------------------------
1 | ,i01,
2 | i02,i03,i04
3 | -1,0,1
--------------------------------------------------------------------------------
/inst/extdata/importexample/qsorts/before/JaneDoe.csv:
--------------------------------------------------------------------------------
1 | ,i01,
2 | i02,i03,i04
3 | -1,0,1
--------------------------------------------------------------------------------
/inst/extdata/importexample/qsorts/before/JohnDoe.csv:
--------------------------------------------------------------------------------
1 | ,i01,
2 | i02,i03,i04
3 | -1,0,1
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/english/life-with-q.tex:
--------------------------------------------------------------------------------
1 | And life is not easy for the R-legionaries who bother to read the works of Stephenson and Brown, for these posit actual Q logics of inquiry.
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/english/q-uprising.tex:
--------------------------------------------------------------------------------
1 | All of the social sciences?
2 | Well, not entirely \ldots .
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/english/r-dominance.tex:
--------------------------------------------------------------------------------
1 | The year is 2014 AD.
2 | The empirical social sciences are entirely occupied by survey research.
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/english/small-village.tex:
--------------------------------------------------------------------------------
1 | One small community of indomitable Q-methodologists still holds out against the survey-wiedling bean counters of social change.
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/english/video.tex:
--------------------------------------------------------------------------------
1 | check out this video: https://www.youtube.com/watch?v=k61ETJK31ao
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/german/life-with-q.tex:
--------------------------------------------------------------------------------
1 | Und das Leben ist nicht leicht fuer die R-Legionaere, die sich die Muehe machen Stephenson und Brown zu lesen, denn diese stellen eigene Q-Forschungslogiken auf.
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/german/q-uprising.tex:
--------------------------------------------------------------------------------
1 | Die ganzen Sozialwissenschaften \ldots ?
2 | Nein!
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/german/r-dominance.tex:
--------------------------------------------------------------------------------
1 | Wir befinden uns im Jahre 2014 nach Christus.
2 | Die empirischen Sozialwissenschaften sind vollstaendig besetzt von der Umfrageforschung.
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/german/small-village.tex:
--------------------------------------------------------------------------------
1 | Ein von unbeugsamen Q-Methodologen bewohntes Dorf hoert nicht auf Widerstand zu leisten gegen die Fragebogen-wedelnden Erbsenzaehler.
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/german/video.tex:
--------------------------------------------------------------------------------
1 | schaut mal das video an: https://www.youtube.com/watch?v=k61ETJK31ao
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/concourse/ids.csv:
--------------------------------------------------------------------------------
1 | ID,handle
2 | i01,r-dominance
3 | i02,q-uprising
4 | i03,small-village
5 | i04,life-with-q
6 | i05,video
7 |
--------------------------------------------------------------------------------
/inst/extdata/importexample/sample/sampling-structure.csv:
--------------------------------------------------------------------------------
1 | handle
2 | life-with-q
3 | q-uprising
4 | r-dominance
5 | small-village
6 |
--------------------------------------------------------------------------------
/inst/shiny-examples/qmethod-gui/rsconnect/shinyapps.io/azabala/qmethod-gui.dcf:
--------------------------------------------------------------------------------
1 | name: qmethod-gui
2 | title: qmethod-gui
3 | username:
4 | account: azabala
5 | server: shinyapps.io
6 | hostUrl: https://api.shinyapps.io/v1
7 | appId: 33162
8 | bundleId: 7947984
9 | url: https://azabala.shinyapps.io/qmethod-gui/
10 | asMultiple: FALSE
11 | asStatic: FALSE
12 |
--------------------------------------------------------------------------------
/inst/shiny-examples/qmethod-gui/server.R:
--------------------------------------------------------------------------------
1 | library(shiny)
2 | library(qmethod)
3 | library(knitr)
4 | data(lipset)
5 |
6 |
7 | shinyServer(function(input, output) {
8 |
9 | data <- reactive({
10 | inFile <- input$file1
11 | if (input$statnames) read.csv(inFile$datapath, header=input$header, sep=input$sep, quote=input$quote, row.names=1) else read.csv(inFile$datapath, header=input$header, sep=input$sep, quote=input$quote)
12 | })
13 |
14 | output$contents <- renderTable({
15 | # input$file1 will be NULL initially. After the user selects
16 | # and uploads a file, it will be a data frame with 'name',
17 | # 'size', 'type', and 'datapath' columns. The 'datapath'
18 | # column will contain the local filenames where the data can
19 | # be found.
20 | inFile <- input$file1
21 | if (is.null(inFile))
22 | return(NULL)
23 | data()
24 | })
25 |
26 | output$rawinfo <- renderText({
27 | inFile <- input$file1
28 | if (is.null(inFile))
29 | return(NULL)
30 | raw <- data()
31 | paste0("The loaded data have ", nrow(raw)," statements and ", ncol(raw)," Q-sorts")})
32 |
33 | output$codeUpload <- renderText({
34 | inFile <- input$file1
35 | if (is.null(inFile))
36 | return("Customised code will display here when some data is uploaded in step 1 above.")
37 | paste0("library(qmethod)
38 | mydata <- read.csv('", input$file1[[1]], "',
39 | header = ", input$header, ", sep = '", input$sep, "', quote = '", input$quote, "')")
40 | })
41 |
42 | output$codeQmethod <- renderText({
43 | inFile <- input$file1
44 | if (is.null(inFile))
45 | return("Customised code will display here when some data is uploaded in step 1 above.")
46 | paste0("results <- qmethod(mydata, nfactors = ", input$nfactors, ", extraction = ",
47 | input$extraction, ", rotation = ", input$rotation, ")")
48 | })
49 |
50 | output$codeSave <- renderText({
51 | inFile <- input$file1
52 | if (is.null(inFile))
53 | return("Customised code will display here when some data is uploaded in step 1 above.")
54 | paste0("save(results, 'qm_results.RData')")
55 | })
56 |
57 | output$codeReport <- renderText({
58 | inFile <- input$file1
59 | if (is.null(inFile))
60 | return("Customised code will display here when some data is uploaded in step 1 above.")
61 | paste0("export.qm(results, 'qm_report.txt', style='PQMethod')")
62 | })
63 |
64 | output$codePlot <- renderText({
65 | inFile <- input$file1
66 | if (is.null(inFile))
67 | return("Customised code will display here when some data is uploaded in step 1 above.")
68 | paste0("plot(results, sub='Plot of statement z-scores (filled points: distinguishing items)')
69 |
70 | abline(v=0, col='grey')")
71 | })
72 |
73 | output$qmPlot <- renderPlot({
74 | inFile <- input$file1
75 | if (is.null(input$file1))
76 | return(NULL)
77 | results <- qmethod(data(), nfactors=input$nfactors, rotation=input$rotation, extraction=input$extraction)
78 | par(mai=c(1,input$maileft,0,0), omi=c(0,0,0,0))
79 | plot(results, sub="Plot of statement z-scores", ylab="")
80 | abline(v=0, col="grey")
81 | })
82 |
83 | output$summary <- renderPrint({
84 | inFile <- input$file1
85 | if (is.null(input$file1))
86 | return("Summary of results will display here when some data is uploaded in step 1 above.")
87 | results <- qmethod(data(), nfactors=input$nfactors, rotation=input$rotation, extraction=input$extraction)
88 | cat("\nFactor scores\n")
89 | print(results[[6]])
90 | })
91 |
92 | output$fullResults <- renderPrint({
93 | inFile <- input$file1
94 | if (is.null(input$file1))
95 | return("Summary of results will display here when some data is uploaded in step 1 above.")
96 | results <- qmethod(data(), nfactors=input$nfactors, rotation=input$rotation, extraction=input$extraction, silent=T)
97 | print(results, length=max(dim(results[[2]])))
98 | })
99 |
100 | output$flaggedqsorts <- renderPrint({
101 | inFile <- input$file1
102 | if (is.null(input$file1))
103 | return("Flagged Q-sorts will display here when some data is uploaded in step 1 above.")
104 | results2 <- qmethod(data(), nfactors=input$nfactors2, rotation=input$rotation2, extraction=input$extraction2)
105 | flagqs <- loa.and.flags(results2)
106 | cat("\nNumber of Q-sorts flagged for each factor:\n")
107 | print(results2[[7]][[1]]["nload"])
108 | cat("\n")
109 | print(flagqs)
110 | })
111 |
112 | output$factorsel <- renderPrint({
113 | inFile <- input$file1
114 | if (is.null(input$file1))
115 | return("Information to select the number of factors will display here when some data is uploaded in step 1 above.")
116 | results3 <- qmethod(data(), nfactors=input$nfactors3, rotation=input$rotation3, extraction=input$extraction3)[[7]]
117 | cat("\nGeneral factor characteristics:\n")
118 | print(round(results3[[1]], digits=2))
119 | cat("\nTotal variance explained: ")
120 | tve <- round(sum(results3[[1]]$expl_var), digits=2)
121 | cat(tve, "%")
122 | cat("\n\nCorrelation between factor z-scores:\n")
123 | print(round(results3[[2]], digits=2))
124 | })
125 |
126 | output$screePlot <- renderPlot({
127 | inFile <- input$file1
128 | if (is.null(input$file1))
129 | return(NULL)
130 | screeplot(prcomp(data()), type="lines", main="Screeplot of unrotated PCA components")
131 | abline(h=1, col="grey")
132 | })
133 | })
--------------------------------------------------------------------------------
/inst/shiny-examples/qmethod-gui/ui.R:
--------------------------------------------------------------------------------
1 | library(shiny)
2 |
3 | shinyUI(fluidPage(
4 | # Application title
5 | HTML("Demo: 'qmethod' package to analyse Q methodology data in R
"),
6 | HTML("
"),
7 | sidebarLayout(
8 | sidebarPanel(
9 | HTML("See more information about the package, a cookbook, and a paper on its implementation and validation.
"),
10 | HTML("Technical notes: 1) This interface performs the analysis only on Q studies with 'forced' distribution. To run the analysis with non-forced distributions, see documentation. 2) Q-sorts are flagged automatically. You can explore this flagging below. Manual flagging is possible using R beyond this simplified interface. Questions & comments (including how to improve this GUI) to aiora [dot] zabala (at) gmail [dot] com
")
11 | ),
12 |
13 | mainPanel(
14 | HTML("This is a graphical user interface (GUI) of the R package 'qmethod', with basic functionality.
"),
15 | HTML("Follow these steps to analyse Q methodology data:
16 |
17 |
18 |
19 | - Upload your data from a *.csv file.
20 |
21 | - Select the extraction method ('PCA' or 'centroid'), the rotation method ('varimax' is most common), and the number of factors to extract.
22 |
23 |
24 |
25 | Full results are displayed at the end. To run the same analysis directly in R and use the full package functionality, see the code created below in Run the analysis directly in R. To run this interface locally in your computer, Install the offline version.
26 |
27 | "),
28 |
29 | HTML("Advanced: 1) explore the flagging of Q-sorts resulting from different number of factors below, or 2) information to aid the selection of number of factors below.
")
30 | )
31 | ),
32 |
33 | HTML("
"),
34 | h3('Step 1. Upload your data'),
35 |
36 | sidebarLayout(
37 | sidebarPanel(
38 | fileInput('file1', 'Choose CSV File',
39 | accept=c('text/csv',
40 | 'text/comma-separated-values,text/plain',
41 | '.csv')),
42 | HTML("See an example of the format of the dataset here.
"),
43 | tags$hr(),
44 | checkboxInput('header', 'Header', TRUE),
45 | checkboxInput('statnames', 'Statement names in 1st column', FALSE),
46 | radioButtons('sep', 'Separator',
47 | c(Comma=',',
48 | Semicolon=';',
49 | Tab='\t'),
50 | ','),
51 | radioButtons('quote', 'Quote',
52 | c(None='',
53 | 'Double Quote'='"',
54 | 'Single Quote'="'"),
55 | '"')
56 | ),
57 |
58 | mainPanel(
59 | textOutput('rawinfo'),
60 | tableOutput('contents')
61 | )
62 | ),
63 |
64 | HTML("
"),
65 |
66 | h3('Step 2. Select the extraction and rotation methods and the number of factors'),
67 |
68 | sidebarLayout(
69 | sidebarPanel(
70 | sliderInput("nfactors", label = "Number of factors:",
71 | min = 2, max = 7, value = 3, step = 1),
72 | selectInput("extraction", label = "Extraction:",
73 | choices = c("PCA", "centroid"), selected = "PCA"),
74 | selectInput("rotation", label = "Rotation:",
75 | choices = c("none", "varimax", "quartimax", "promax", "oblimin", "simplimax", "cluster"), selected = "varimax"),
76 | sliderInput("maileft", label = "Item margin:",
77 | min = 0.8, max = 2.8, value = 1, step = 0.2),
78 | ),
79 |
80 | mainPanel(
81 | plotOutput("qmPlot"),
82 | verbatimTextOutput("summary")
83 | )
84 | ),
85 |
86 | HTML("
"),
87 |
88 | HTML("Run the analysis directly in R
"),
89 |
90 | sidebarLayout(
91 | sidebarPanel(
92 | HTML("To run the above analysis in R and explore the results further, copy and paste the code on the right. (You need to install R AND install the 'qmethod' package in your computer first if you have not done so already).")
93 | ),
94 | mainPanel(
95 | p("1. Load the package and upload your data:"),
96 | verbatimTextOutput("codeUpload"),
97 | p("2. Run Q analysis:"),
98 | verbatimTextOutput("codeQmethod"),
99 | p("3. Plot the results:"),
100 | verbatimTextOutput("codePlot"),
101 | p("4. Save your data in R format:"),
102 | verbatimTextOutput("codeSave"),
103 | p("5. Export the full report of results in plain text:"),
104 | verbatimTextOutput("codeReport")
105 | )
106 | ),
107 |
108 | HTML("
"),
109 | HTML("Advanced: Explore the flagged Q-sorts
"),
110 | p("The table indicates with an '*' those Q-sorts flagged for each factor, using the automatic method. Change the number of factors in the slider below, to see how flaggings vary."),
111 |
112 | sidebarLayout(
113 | sidebarPanel(
114 | sliderInput("nfactors2", label = "Number of factors:", min = 2, max = 7, value = 3, step = 1),
115 | selectInput("extraction2", label = "Extraction:",
116 | choices = c("PCA", "centroid"), selected = "PCA"),
117 | selectInput("rotation2", label = "Rotation:",
118 | choices = c("none", "varimax", "quartimax", "promax", "oblimin", "simplimax", "cluster"), selected = "varimax")
119 | ),
120 |
121 | mainPanel(
122 | verbatimTextOutput("flaggedqsorts")
123 | )
124 | ),
125 |
126 | HTML("
"),
127 | HTML("Advanced: Explore how many factors to extract
"),
128 |
129 | sidebarLayout(
130 | sidebarPanel(
131 | sliderInput("nfactors3", label = "Number of factors:",
132 | min = 2, max = 7, value = 3, step = 1),
133 | selectInput("extraction3", label = "Extraction:",
134 | choices = c("PCA", "centroid"), selected = "PCA"),
135 | selectInput("rotation3", label = "Rotation:",
136 | choices = c("none", "varimax", "quartimax", "promax", "oblimin", "simplimax", "cluster"), selected = "varimax")
137 | ),
138 |
139 | mainPanel(
140 | verbatimTextOutput("factorsel"),
141 | plotOutput("screePlot")
142 | )
143 | ),
144 |
145 | HTML("
"),
146 | HTML("Full results
"),
147 |
148 | fluidRow(
149 | verbatimTextOutput("fullResults")
150 | )
151 | ))
152 |
--------------------------------------------------------------------------------
/man/build.q.set.Rd:
--------------------------------------------------------------------------------
1 | \name{build.q.set}
2 | \alias{build.q.set}
3 | \title{Q methodology: sample a Q set from a concourse}
4 | \description{
5 | Subsets a concourse of items into a sample of selected items.
6 | Returns a dataframe with handles as row names, and languages (if applicable) as columns.
7 | }
8 | \usage{
9 | build.q.set(q.concourse, q.sample, q.distribution)
10 | }
11 |
12 | \arguments{
13 | \item{q.concourse}{
14 | A matrix with handles as row names, (optional) languages as columns, and full item wordings in cells as produced by \code{\link{import.q.concourse}}.
15 | }
16 | \item{q.sample}{
17 | A character vector of handles (such as \kbd{q-is-great}).
18 | The items identified by the handles will be sampled.
19 | }
20 | \item{q.distribution}{
21 | The chosen Q distribution as a vector of integers, such as \code{c(1,3,1)}.
22 | }
23 | }
24 | \details{
25 | Q studies are carried out letting participants rank a \emph{sample} of statements (items), collectively referred to as the \emph{Q set}.
26 | These Q sets are drawn (by some sampling strategy) from a \emph{concourse}, or universe of items.
27 | This function subsets the concourse generated by \code{\link{import.q.concourse}}, based on a vector of handles provided, and returns it as \code{q.set}.
28 |
29 | The function implements a number of tests on the validity and consistency of inputs.
30 |
31 | If you are not familiar with the terminology of item \emph{handle}, \emph{ID} and \emph{wording} or the file structure expected for import functions, please read the respective sections in the documentation for \link{qmethod-package} first or consider the package \href{http://aiorazabala.github.io/qmethod/Data-management}{website}.
32 | }
33 |
34 | \value{
35 | Returns a matrix with handles as row names, languages (if applicable) as column names and full item wordings in cells.
36 | }
37 |
38 | \note{
39 | This function currently does \emph{not} actually \emph{draw} a sample, but merely builds the Q set from a \emph{given} sample.
40 |
41 | This function currently requires input in the argument \code{q.distribution}, but it only checks for the sum, so if you are working with a distribution-free study that still has a fixed number of items, you can just enter a vector of length 1 with your total sum of items.
42 | }
43 |
44 | \author{Maximilian Held}
45 |
46 | \seealso{
47 | \code{\link{import.q.concourse}},
48 | \code{\link{import.q.feedback}},
49 | \code{\link{import.q.sorts}},
50 | \code{\link{make.cards}}
51 | }
52 |
53 | \examples{
54 | # Build a Q Set from a concourse and a sample
55 | data(importexample)
56 | q.set <- build.q.set(
57 | q.concourse = importexample$q.concourse, # as created by import.q.concourse
58 | q.sample = c("life-with-q","q-uprising","r-dominance","small-village"),
59 | # add vector with items to be selected from concourse
60 | # q.sample is ideally read in from a separate *.CSV file
61 | q.distribution = c(1,2,1) # very simple distribution
62 | )
63 | }
64 |
--------------------------------------------------------------------------------
/man/centroid.Rd:
--------------------------------------------------------------------------------
1 | \name{centroid}
2 | \alias{centroid}
3 | \title{Q methodology: centroid extraction}
4 | \description{Extracts factors/ components using the centroid approach as an alternative to Principal Components Analysis.}
5 | \usage{centroid(tmat, nfactors = 7, spc)}
6 |
7 | \arguments{
8 | \item{tmat}{a correlation matrix between Q-sorts.}
9 | \item{nfactors}{number of factors/ components to extract. Defaults to 7.}
10 | \item{spc}{the threshold to accept factor results, set to 0.00001 by default (in Brown 1980, this is set to 0.02).}
11 | }
12 |
13 | \details{This functions implement the centroid method for extraction of factors, an alternative to Principal Components that can be used in Q methodology. The calculations are based in Brown (1980; below).
14 |
15 | The function is called from within \code{\link{qmethod}} where the attribute \code{extraction} is set to \code{centroid}.
16 |
17 | This function can be used independently where conducting each step of the analysis separately, preceded by a correlation between Q-sorts and followed by the rotation of factors/ components (see below), calculation of z-scores, etc.
18 | }
19 | \value{
20 | Returns a matrix with Q-sorts as rows, and rotated factors as columns.
21 | }
22 | \references{Brown, S. R., 1980 \emph{Political subjectivity: Applications of Q methodology in political science}, New Haven, CT: Yale University Press, pages 208-224.
23 |
24 | See further references on the methodology in \code{\link{qmethod-package}}.}
25 |
26 | \note{This is a function used within \code{\link{qmethod}}. Rarely to be used independently.}
27 |
28 | \author{Frans Hermans}
29 |
30 | \examples{
31 | #### Example
32 | require('qmethod')
33 | require ("psych")
34 |
35 | # Load data
36 | data("lipset")
37 | lip <- lipset[[1]]
38 |
39 | # Correlation matrix
40 | corlip <-cor(lip)
41 |
42 | # Centroid extraction
43 | lipcent <- centroid(corlip)
44 | lipcent
45 |
46 |
47 | ## To finalise the full analysis, continue with the following steps
48 | # Rotation (in this example, varimax over 3 factors)
49 | vmax <- varimax(lipcent[,1:3])
50 |
51 | # Automatic pre-flagging of Q-sorts
52 | flags <- qflag(unclass(vmax$loadings), nstat = 33)
53 |
54 | # Calculate z-scores and general characeristics
55 | results <- qzscores(lip, 3, loa=vmax$loadings, flagged=flags)
56 | summary(results)
57 |
58 | # Consensus and distinguishing statements
59 | results$qdc <- qdc(lip, 3, zsc=results$zsc, sed=results$f_char$sd_dif)
60 |
61 | plot(results)
62 |
63 | ## All of the above can be done with:
64 | results2 <- qmethod(lip, 3, extraction="centroid")
65 | }
--------------------------------------------------------------------------------
/man/export.pqmethod.Rd:
--------------------------------------------------------------------------------
1 | \name{export.pqmethod}
2 | \alias{export.pqmethod}
3 | \title{Q methodology: export to PQMethod *.DAT and *.STA files}
4 | \description{Exports Q data to *.DAT and *.STA files readable in PQMethod software.}
5 | \usage{export.pqmethod(dataset, study.name,
6 | study.description, col.range,
7 | filename='Q_data_forPQmethod',
8 | left.zeros, right.zeros, statements)}
9 |
10 | \arguments{
11 | \item{dataset}{a matrix or data frame qwith Q data: Q-sorts as columns and statements as rows. The names of the columns will be used as Q-sort IDs in the *.DAT file.}
12 | \item{study.name}{a string with a short name of the study. No space characters are allowed.}
13 | \item{study.description}{a string with a one-sentence description of the study).}
14 | \item{col.range}{a two-element numerical vector with the values at the two extremes of the Q distribution (e.g. \code{c(-4, 4)}).}
15 | \item{filename}{a filename. The extension *.DAT is added automatically).}
16 | \item{left.zeros}{number of zeros before the distribution, in the second line of *.DAT file.}
17 | \item{right.zeros}{number of zeros after the distribution, in the second line of *.DAT file).}
18 | \item{statements}{a matrix with statements, one in each row).}
19 | }
20 | \details{
21 | Exports the raw data of a Q methodology study into the native format used in PQMethod. Returns a message with some basic information about the data.
22 |
23 | Note that \bold{no checks are made on the data}, such as whether there are duplicated or non-forced Q-sorts.
24 |
25 | This function is not applicable to non-forced distributions.
26 |
27 | }
28 |
29 | \references{Schmolck, Peter, 2014. \emph{PQMethod Software}, Available at: \url{http://schmolck.org/qmethod/}
30 |
31 | File descriptions in \emph{PQMethod Manual}: \url{http://schmolck.org/qmethod/pqmanual.htm#appdxa}}
32 |
33 | \author{Aiora Zabala}
34 |
35 | \note{This function is experimental. Use with caution and verify that the output is as desired.}
36 |
37 | \examples{
38 | # data(lipset)
39 | # db <- lipset[[1]]
40 | # export.pqmethod(dataset = db,
41 | # study.name = 'mystudy',
42 | # study.description = 'great study',
43 | # col.range = c(-4, 4),
44 | # filename = 'mystudy',
45 | # statements=lipset[[2]])
46 | }
47 |
--------------------------------------------------------------------------------
/man/export.qm.Rd:
--------------------------------------------------------------------------------
1 | \name{export.qm}
2 | \alias{export.qm}
3 | \title{Q Methodology: export results to a plain text document}
4 | \description{Exports an object of class \code{QmethodRes} to a plain text file (*.TXT). All the objects within the list resulting from \code{\link{qmethod}} are exported as they are. This is intended for interpretation rather than for further analysis.}
5 | \usage{export.qm(qmobject, file, style= c("R", "PQMethod"))}
6 |
7 | \arguments{
8 | \item{qmobject}{an object of Q methodology results, obtained from the function \code{\link{qmethod}}.}
9 | \item{file}{the file name. Note that in some operating systems, the file name will need an extension *.TXT so that other software opens it.}
10 | \item{style}{the structure and formatting of the results in the exported document. Defaults to \code{"R"} where the \code{qmobject} will be written as is. Option \code{"PQMethod"} provides an output with similar structure and elements as those provided by PQMethod software in the *.LIS files (see details of *.LIS files in the References below). Note that the latter creates a much longer document.}
11 | }
12 |
13 | \references{Schmolck. \emph{PQMethod Software (Version 2.35)}, 2014. \url{http://schmolck.org/qmethod/}
14 |
15 | File descriptions in \emph{PQMethod Manual}: \url{http://schmolck.org/qmethod/pqmanual.htm#appdxa}
16 | }
17 |
18 | \author{Aiora Zabala}
--------------------------------------------------------------------------------
/man/import.easyhtmlq.Rd:
--------------------------------------------------------------------------------
1 | \name{import.easyhtmlq}
2 | \alias{import.easyhtmlq}
3 | \title{Q methodology: import data from easy-HTMLQ}
4 | \description{Imports data from *.JSON files created with easy-HTMLQ software for Q-sort administration.}
5 | \usage{import.easyhtmlq(filename, ...)}
6 |
7 | \arguments{
8 | \item{filename}{a file with extension *.JSON (see full description of the file below in References).}
9 | \item{...}{further arguments to be passed to \code{\link[utils]{read.csv2}}.}
10 | }
11 | \details{
12 | Extracts the raw data of a Q methodology study from the native format saved in \emph{easy-HTMLQ}. Returns a list with two objects.
13 |
14 | The first object contains a data frame with items as rows and Q-sorts as columns, ready to be used in \code{\link{qmethod}}. It sets the Q-sort names to the values in the column 'uid' or else in 'sid'.
15 |
16 | The second object contains the additional data collected. Columns \code{npos}, \code{nneu} and \code{nneg} have the number of items allocated to the groups of 'positive', 'neutral', and 'negative' respectively. Columns which name start with \code{comment*} and \code{form*} contain further information introduced by the respondent. Columns which name start with \code{dur*} contain the time that the respondent spent in each screen. Column \code{datetime} contains the data stamp when the Q-sort was submitted.
17 | }
18 |
19 | \author{Aiora Zabala}
20 |
21 | \references{Banasick, Shawn, 2021. \emph{easy-htmlq}, Available at: \url{https://github.com/shawnbanasick/easy-htmlq}, based on Oschlies, Johannes and Killing, Marvin, 2015. \emph{HTMLQ}, Available at: \url{https://github.com/aproxima/htmlq}
22 | }
--------------------------------------------------------------------------------
/man/import.htmlq.Rd:
--------------------------------------------------------------------------------
1 | \name{import.htmlq}
2 | \alias{import.htmlq}
3 | \title{Q methodology: import data from HTMLQ and FlashQ}
4 | \description{Imports data from *.CSV files created with HTMLQ or FlashQ softwares for Q-sort administration.}
5 | \usage{import.htmlq(filename, ...)}
6 |
7 | \arguments{
8 | \item{filename}{a file with extension *.CSV, separated by ";" as done by default in HTMLQ (see full description of the file below in References).}
9 | \item{...}{further arguments to be passed to \code{\link[utils]{read.csv2}}.}
10 | }
11 | \details{
12 | Extracts the raw data of a Q methodology study from the native format saved in both \emph{FlashQ} and \emph{HTMLQ}. Returns a list with two objects.
13 |
14 | The first object contains a data frame with items as rows and Q-sorts as columns, ready to be used in \code{\link{qmethod}}. It sets the Q-sort names to the values in the column 'uid' or else in 'sid'.
15 |
16 | The second object contains the additional data collected. Columns \code{npos}, \code{nneu} and \code{nneg} have the number of items allocated to the groups of 'positive', 'neutral', and 'negative' respectively. Columns which name start with \code{comment*} and \code{form*} contain further information introduced by the respondent. Columns which name start with \code{dur*} contain the time that the respondent spent in each screen. Column \code{datetime} contains the data stamp when the Q-sort was responded.
17 | }
18 |
19 | \author{Aiora Zabala}
20 |
21 | \references{Hackert, Christian and Braehler, Gernot, 2007. \emph{FlashQ}, Used to be available at: http://www.hackert.biz/flashq, but offline as tested on Feb 2021.
22 |
23 | Oschlies, Johannes and Killing, Marvin, 2015. \emph{HTMLQ}, Available at: \url{https://github.com/aproxima/htmlq}
24 | }
--------------------------------------------------------------------------------
/man/import.pqmethod.Rd:
--------------------------------------------------------------------------------
1 | \name{import.pqmethod}
2 | \alias{import.pqmethod}
3 | \title{Q methodology: import PQMethod *.DAT files}
4 | \description{Imports data from *.DAT files created in PQMethod software.}
5 | \usage{import.pqmethod(file, ...)}
6 |
7 | \arguments{
8 | \item{file}{a file with extension *.DAT (see full description of the file below in References).}
9 | \item{...}{further arguments to be passed to \code{\link[utils]{read.table}} and \code{\link[utils]{read.fwf}}.}
10 | }
11 | \details{
12 | Extracts the raw data of a Q methodology study from the native format used in PQMethod. Returns a data frame with statements as rows and Q-sorts as columns.
13 |
14 | If the following error occurs: \code{"invalid multibyte string"}, a possible solution is to either set the right file-encoding in the argument \code{fileEncoding} or inspect the file for uncommon characters (see details in \code{\link[utils]{read.table}}).
15 | }
16 |
17 | \references{Schmolck, Peter, 2014. \emph{PQMethod Software}, Available at: \url{http://schmolck.org/qmethod/}
18 |
19 | File descriptions in \emph{PQMethod Manual}: \url{http://schmolck.org/qmethod/pqmanual.htm#appdxa}}
20 |
21 | \author{Aiora Zabala}
--------------------------------------------------------------------------------
/man/import.q.concourse.Rd:
--------------------------------------------------------------------------------
1 | \name{import.q.concourse}
2 | \alias{import.q.concourse}
3 | \title{Q methodology: import concourse of Q items}
4 | \description{
5 | Imports a full set of items (statements in a concourse) from a directory of *.TEX files (one file per item), including possible translations in separate folders.
6 | }
7 | \usage{
8 | import.q.concourse(q.concourse.dir, languages = NULL)
9 | }
10 |
11 | \arguments{
12 | \item{q.concourse.dir}{
13 | A directory of \emph{individual} item wordings in *.TEX files with handles as filenames (e.g. \kbd{happy-feeling.tex}).
14 | If \code{languages} are specified, the directory should contain one folder per language, with all full item wordings as individual *.TEX files in \emph{each} language folder.
15 | Items should have the \emph{same} file name across all languages (e.g. \kbd{happy-feeling.tex}).
16 | Directories end with a trailing slash, such as \code{study/q-sample/q-concourse/}.
17 | }
18 | \item{languages}{
19 | A character vector of languages, same as folders within \code{q.concourse.dir}.
20 | If the concourse is monolingual, leave empty. Defaults to \code{NULL}.
21 | }
22 | }
23 | \details{
24 | Q studies are conducted by asking participants (or a P set) to rank order a \emph{sample} (or Q Set) of items, drawn from a universe (or concourse) of items, based on some sampling strategy.
25 | A concourse is, simply put, \emph{the sum of all things people could say about a subject matter}.
26 |
27 | It is helpful to keep the \emph{entire} concourse readily available, so as to draw samples from it.
28 |
29 | For some studies, it is necessary to have the complete items available in several languages.
30 |
31 | This function simply imports all full item wordings and assigns a \emph{handle} for the item, based on the filename (see \link{qmethod-package}).
32 | These filenames should be short and meaningful to the researcher.
33 |
34 | Individual items as *.TEX files should include minimal markup, and no trailing whitespace or empty newlines.
35 | If you do not need any additional formatting, you can just save plain text files (*.TXT) with the extension *.TEX.
36 | There is no need to know \href{https://www.latex-project.org/}{LaTeX}.
37 |
38 | Returns error if items are not available in all translations.
39 |
40 | Defaults to monolingual variant.
41 |
42 | If you are not familiar with the terminology of Q item \emph{handle}, \emph{ID} and \emph{wording} or the file structure expected for import functions, please read the respective sections in the documentation for \link{qmethod-package} first or consider the package \href{http://aiorazabala.github.io/qmethod/Data-management}{website}.
43 | }
44 | \value{
45 | Returns a character matrix with handles as row names, languages (if applicable) as columns and full item wording per language in cells.
46 | }
47 |
48 | \author{Maximilian Held}
49 |
50 | \seealso{
51 | \code{\link{build.q.set}},
52 | \code{\link{import.q.feedback}},
53 | \code{\link{import.q.sorts}},
54 | \code{\link{make.cards}}
55 | }
56 |
57 | \examples{
58 | ## Import a full q concourse from 'importexample' dataset
59 | path.concourse <- paste( # this part is only for the example!
60 | path.package("qmethod"), # just to make sure, use absolute path
61 | # import example files are in root/extdata of package
62 | "/extdata/importexample/sample/concourse/", # location of concourse
63 | sep = ""
64 | )
65 | q.concourse <- import.q.concourse( # import concourse
66 | q.concourse.dir = path.concourse, # insert your applicable path here
67 | languages = c("english","german") # choose your languages from path here
68 | )
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/man/import.q.feedback.Rd:
--------------------------------------------------------------------------------
1 | \name{import.q.feedback}
2 | \alias{import.q.feedback}
3 | \title{Q methodology: imports feedback on Q items}
4 | \description{
5 | Turns raw item feedback (in *.CSV files) into a verified array or matrix.
6 | }
7 | \usage{
8 | import.q.feedback(q.feedback.dir, q.sorts, q.set, manual.lookup = NULL)
9 | }
10 |
11 | \arguments{
12 | \item{q.feedback.dir}{
13 | A relative path to a directory structure where:
14 | \itemize{
15 | \item (optional) folders are \code{conditions} (such as \kbd{before} and \kbd{after}), if there is more than one condition.
16 | Conditions are inferred from the specified \code{q.sorts}.
17 | If there are no conditions, there should be no folders.
18 | \item filenames of *.CSV are participant names (might be given pseudonyms).
19 | \item *.CSV files within folders contain raw feedback, beginning with an arbitrary header line (ignored), and the following columns, starting from the left:
20 | \enumerate{
21 | \item An ID, either as an automatic hash or manually specified (see \code{\link{qmethod-package}}), as specified per the \code{manual.lookup} option of \code{\link{make.cards}}.
22 | Each ID only occurs once.
23 | \item The full feedback in plain text, enclosed in quotes.
24 | \item Optionally, a logical indicator whether current line should be ignored (in which case it should be set to \code{TRUE}).
25 | If there is no such column, all feedback will be imported.
26 | }
27 | }
28 | }
29 | \item{q.sorts}{
30 | A matrix or array with handles as row names, participant as column names, (optional) conditions as 3rd dimension and cells as Q-sort ranks, as produced by \code{\link{import.q.sorts}}.
31 | }
32 | \item{q.set}{
33 | A matrix with handles as row names, languages (if applicable) in columns, as produced by \code{\link{build.q.set}}.
34 | }
35 | \item{manual.lookup}{
36 | A matrix with handles as row names, and IDs (such as \kbd{"sta121"}, as printed on the Q-cards by \code{\link{make.cards}}) in any of the columns.
37 | Defaults to \code{NULL} in which case items IDs are expected to be item wording hashes, as produced by \code{\link{make.cards}}.
38 | }
39 | }
40 |
41 | \details{
42 |
43 | Participants in Q studies are often invited to provide open-ended feedback on items, giving researchers additional information on participants' viewpoints.
44 | This feedback is conveniently entered in a spreadsheet editor (2nd column), where each line of feedback corresponds to an item ID (1st column)
45 | An additional, optional (3rd) column indicates whether the current line should be ignored (\code{TRUE}), as may be the case for privacy reasons or when the feedback is merely a correction of a typographic error.
46 | If no such 3rd column is included, all feedback will be imported.
47 |
48 | The automatic summary of full item wordings, technically known as \emph{hashing}, proceeds internally by passing the full item wording to the \code{\link[digest]{digest}} function of the package \pkg{digest} (with arguments set to \code{algo = crc32, serialize = FALSE}.)
49 |
50 | After an (arbitrary) header line, a *.CSV file may look like this:\cr
51 | \samp{sta001,"This q-item sounds like r-research to me!",FALSE}, indicating that it should \emph{not} be ignored (\kbd{FALSE}).
52 |
53 | If you are not familiar with the terminology of item \emph{handle}, \emph{ID} and \emph{wording} or the file structure expected for import functions, please read the respective sections in the documentation for \link{qmethod-package} first or consider the package \href{http://aiorazabala.github.io/qmethod/Data-management}{website}.
54 | }
55 |
56 | \value{
57 | Returns a matrix or array (if there is more than one condition) with handles as row names, people as column names, (optional) conditions as 3rd dimension name and item feedback in cells.
58 | The return parallels the output from \code{\link{import.q.sorts}}, but with feedback as array cells, rather than Q-sort ranks.
59 | }
60 |
61 | \author{Maximilian Held}
62 |
63 | \seealso{
64 | \code{\link{import.q.concourse}},
65 | \code{\link{import.q.sorts}},
66 | \code{\link{build.q.set}},
67 | \code{\link{make.cards}},
68 | \code{\link{qmethod}}
69 | }
70 |
71 | \examples{
72 | data(importexample)
73 | path.feedback <- paste( # this part is only for the example!
74 | path.package("qmethod"), # just to make sure, use absolute path
75 | # import example files are in root/extdata of package:
76 | "/extdata/importexample/feedback/", # location of sorts
77 | sep = ""
78 | )
79 | q.feedback <- import.q.feedback( # now import the feedback
80 | q.feedback.dir = path.feedback, # add your path here
81 | q.sorts = importexample$q.sorts,
82 | q.set = importexample$q.set, # as produced by build.q.set
83 | manual.lookup = matrix( # ideally empty for automatic hashing, or read in from *.CSV
84 | c("i01","i02","i03","i04"),
85 | ncol = 1,
86 | nrow = 4,
87 | dimnames = list(c("r-dominance","q-uprising","small-village","life-with-q"),"ID")
88 | )
89 | )
90 | }
91 |
--------------------------------------------------------------------------------
/man/importexample.Rd:
--------------------------------------------------------------------------------
1 | \name{importexample}
2 | \docType{data}
3 | \alias{importexample}
4 | \title{Import Example}
5 | \description{
6 | A minimum working example (MWE) to test the functions \code{\link{import.q.concourse}}, \code{\link{build.q.set}}, \code{\link{import.q.sorts}}, \code{\link{import.q.feedback}} and \code{\link{make.cards}}.
7 | The example is too small to run an actual Q analysis.
8 | To test out a real study with the same data structure, go to: \url{https://github.com/maxheld83/keyneson}.
9 | }
10 | \usage{importexample}
11 | \format{
12 | \code{importexample} is included as a directory in \code{qmethod} package root folder, including subdirectories as documented in the package documentation, and on the package \href{http://aiorazabala.github.io/qmethod/Data-management}{website}.
13 | Importexample is \emph{also} partly included as a ready-made RData datafile in the folder \code{qmethod/data} so that (cumulative) function examples can run.
14 | }
15 | \source{None.}
16 | \keyword{datasets}
17 |
--------------------------------------------------------------------------------
/man/lipset.Rd:
--------------------------------------------------------------------------------
1 | \name{lipset}
2 | \docType{data}
3 | \alias{lipset}
4 | \title{\emph{Lipset} (1963) Q methodology dataset}
5 | \description{Dataset about \emph{The Value Patterns of Democracy} based on Lipset (1963) to illustrate the \pkg{qmethod} package.}
6 | \usage{lipset}
7 | \format{A list with two objects. A data frame with 9 Q sorts sorting 33 statements and a data frame with the text corresponding to the statements.}
8 | \source{Brown, S. R., 1980. \emph{Political subjectivity: Applications of Q methodology in political science}, New Haven, CT: Yale University Press.
9 |
10 | Lipset, S. M., 1963. The value patterns of democracy: A case study in comparative analysis. \emph{American Sociological Review}, 28, 515-531.
11 | }
12 | \keyword{datasets}
13 |
--------------------------------------------------------------------------------
/man/loa.and.flags.Rd:
--------------------------------------------------------------------------------
1 | \name{loa.and.flags}
2 | \alias{loa.and.flags}
3 | \title{Q methodology: show factor loadings next to flags}
4 | \description{Prints a table with factor loadings and flagged Q-sorts are indicated with a star.}
5 | \usage{loa.and.flags(results, nload = FALSE)}
6 |
7 | \arguments{
8 | \item{results}{an object of Q method results.}
9 | \item{nload}{logical; print number of flagged Q-sorts.}
10 | }
11 | \details{
12 | Simple function to explore the Q-sorts that are automatically pre-flagged, using the standard criteria implemented in function \code{\link{qflag}}
13 | }
14 |
15 | \author{Aiora Zabala}
16 |
17 | \examples{
18 | data(lipset)
19 | results <- qmethod(lipset[[1]], nfactors = 3, rotation = "varimax")
20 | loa.and.flags(results)
21 | }
--------------------------------------------------------------------------------
/man/make.cards.Rd:
--------------------------------------------------------------------------------
1 | \name{make.cards}
2 | \alias{make.cards}
3 | \title{Q methodology: produce printable cards for Q study with ID and full item wording}
4 | \description{
5 | Creates cards for administering a Q study.
6 | Full item wordings are printed on the front of business cards and item IDs on the back.
7 | }
8 | \usage{
9 | make.cards(
10 | q.set,
11 | study.language = NULL,
12 | paper.format = "AveryZweckformC32010.Rnw",
13 | output.pdf = TRUE,
14 | manual.lookup = NULL,
15 | wording.font.size = NULL,
16 | file.name = "QCards",
17 | babel.language = NULL
18 | )
19 | }
20 |
21 | \arguments{
22 | \item{q.set}{
23 | A matrix with handles as row names ("\code{q-is-great}", for example), languages (if applicable) in columns, as produced by \code{\link{build.q.set}}.
24 | }
25 | \item{study.language}{
26 | A character vector of length 1.
27 | Must be one of the languages from the column names in the specified \code{q.set} (which will be the same as the respective Q concourse object).
28 | Defaults to \code{NULL}, in which case the first column from \code{q.set} is selected.
29 | }
30 | \item{paper.format}{
31 | A character vector of length 1, choosing among available templates of business card sheets.
32 | Defaults to the only currently available \code{"AveryZweckformC32010.Rnw"}.
33 | Must include file extension of template.
34 | }
35 | \item{output.pdf}{
36 | Logical.
37 | If \code{TRUE}, function invokes \code{knit2pdf} to create a PDF in the workspace.
38 | If \code{FALSE}, function invokes \code{knit} to return only a *.TEX in the workspace, may be preferable if no \href{https://www.latex-project.org/}{LaTeX} installation is available on the used computer.
39 | Defaults to \code{TRUE}.
40 | }
41 | \item{manual.lookup}{
42 | A matrix with handles (same as in \code{\link{build.q.set}}, \code{\link{import.q.concourse}}) as row names, and arbitrary, unique identifying strings in any of the columns as also expected in \code{\link{import.q.sorts}} and \code{\link{import.q.feedback}}.
43 | Defaults to \code{NULL} in which case items are automatically identified by full item hashes, as also detected by \code{\link{import.q.sorts}} and \code{\link{import.q.feedback}}.
44 | }
45 | \item{wording.font.size}{
46 | A character vector of length 1 to set the font size of the full item wording on the cards.
47 | Defaults to \code{NULL} in which case the default font size 12pt is used.
48 | Only \href{https://en.wikibooks.org/wiki/LaTeX/Fonts#Sizing_text}{standard LaTeX font sizes} are allowed, from \code{\\tiny} to \code{\\Huge}.
49 | }
50 | \item{file.name}{
51 | A character vector of length 1 to set the output file path relative to the working directory \emph{without file extension}.
52 | Defaults to \code{QCards}.
53 | }
54 | \item{babel.language}{
55 | A character vector of length 1 to set the babel language for appropriate hyphenation, special letters and other international support as provided by the \href{https://www.ctan.org/pkg/babel/}{babel LaTeX package}.
56 | Only available babel options are permissible.
57 | Defaults to \code{NULL}, in which case babel is never called.
58 | Changing \code{babel.language} between function calls can occasionally leave inconsistent LaTeX temp files, which may trip up compilation.
59 | Please re-run the function once again or clean up temp files (in the working directory) in that case.
60 | }
61 | }
62 | \details{
63 |
64 | Preparing cards with full items and IDs quickly becomes cumbersome if a study is done several times or if items change frequently.
65 | Participants require well-printed, well-designed cards for their sorting task, ideally on heavier paper.
66 | Cards should include shorthand, unique identifiers to simplify later data entry.
67 |
68 | This function prepares a properly typeset *.PDF (or *.TEX source), where items are printed on readily-available business card templates, from which individual cards can be easily broken out.
69 |
70 | The function prints the full item wording on the \emph{right} column of any page, and the identifier (ID) on the \emph{left} column.
71 | If templates are duplex printed with the same page on the front and back, and in proper orientation, the front of each card includes the full wording, and the back its unique identifier (ID).
72 |
73 | Identifiers (ID) entered manually or automatically hashed from full wordings are also expected in the import functions \code{\link{import.q.sorts}} and \code{\link{import.q.feedback}}.
74 | The automatic summary of full item wordings, technically known as \emph{hashing}, proceeds internally by passing the full item wording to the \code{\link[digest]{digest}} function of the package \pkg{digest} (with arguments set to
75 |
76 | \code{algo = crc32, serialize = FALSE}.)
77 |
78 | The function proceeds internally by preparing a dataframe with full item wordings and identifiers (ID), and then invokes a prepared \code{*.RNW} template included with this package, which in turn includes a \pkg{knitr} chunk, which in turn calls \pkg{xtable} to return a neatly layed-out multi-page table.
79 |
80 | If you are not familiar with the terminology of item \emph{handle}, \emph{ID} and \emph{wording} or the file structure expected for import functions, please read the respective sections in the documentation for \link{qmethod-package} first or consider the package \href{http://aiorazabala.github.io/qmethod/Data-management}{website}.
81 | }
82 |
83 | \value{
84 | Writes a *.PDF file or its source *.TEX file to the working directory ready for printout.
85 | }
86 |
87 | \note{
88 | Hashed identification has not been widely tested in Q studies and should be used with great care and only for extra convenience.
89 | When using hash identification, researchers should be careful to record the precise item wordings at the time of hashing for the printed Q-cards, preferably with a version control system.
90 | Researchers should also record the complete Q-sorts of participants in an \emph{unhashed} form, such as a picture of the completed sort in full wordings, in case problems with the hashing arise.
91 |
92 | When \code{output.pdf = TRUE}, the function will sometimes fail with the error message\cr \code{"Running 'texi2dvi' on ... failed"}.
93 | This is not a bug with the function, but simply indicates that the path to pdflatex is not available in the current R environment.
94 | To fix this issue, compile the resulting *.TEX manually, use RStudio or try \href{https://www.r-bloggers.com/2012/12/building-r-packages-missing-path-to-pdflatex/}{this fix}.
95 |
96 | This function does \emph{not} automatically scale the font size to fit the given card size.
97 | Instead, users will have to proceed by trial and error, using a \code{wording.font.size} that works for their longest item.
98 | The default value should work for most Q items.
99 |
100 | This function currently only works for Avery Zweckform C32010 templates, designed in\cr \code{/cardtemplates/AveryZweckformC32010.Rnw}.
101 | If you would like support for other templates, check out / chip in here: \url{https://github.com/aiorazabala/qmethod/issues/34}.
102 | }
103 |
104 | \author{Maximilian Held}
105 |
106 | \seealso{
107 | \code{\link{build.q.set}},
108 | \code{\link{import.q.feedback}},
109 | \code{\link{import.q.sorts}},
110 | \code{\link{import.q.concourse}}
111 | }
112 |
113 | \examples{
114 | ## Make cards from importexample
115 | data(importexample)
116 | # use your own output file name or leave NULL for `file.name`
117 | # tempfile() is used here to avoid leaving files behind example code runs
118 | make.cards(importexample$q.set, output.pdf = FALSE, file.name = tempfile())
119 | }
120 |
--------------------------------------------------------------------------------
/man/make.distribution.Rd:
--------------------------------------------------------------------------------
1 | \name{make.distribution}
2 | \alias{make.distribution}
3 | \title{Q methodology: create Q normal distribution}
4 | \description{
5 | Creates a distribution close to a standard normal distribution given a number of statements and a maximum Q sort rank.
6 | }
7 | \usage{
8 | make.distribution(
9 | nstat,
10 | max.bin = 5
11 | )
12 | }
13 |
14 | \arguments{
15 | \item{nstat}{
16 | Number of desired statements in a Q sample for a given study.
17 | Must be a positive integer, vector of length 1.
18 | }
19 | \item{max.bin}{
20 | Maximum positive value to be entered by participants.
21 | Must be a positive integer, vector of length 1.
22 | Defaults to frequent value \code{5}.
23 | }
24 | }
25 | \details{
26 | Participants in Q studies are frequently asked to sort Q items under a quasi-normal distribution.
27 | This function generates such a Q distribution, given a number of statements \code{nstat} and a desired maximum positive value \code{max.bin} in the Q distribution.
28 |
29 | The function always returns an \emph{uneven} number of columns, ensuring that there is always a modal column at the zero mark.
30 |
31 | Not every combination of \code{nstat} and \code{max.bin} can be neatly fit under a standard normal distribution, in which case the function returns a vector of unequal length to the specified \code{nstat}.
32 | The function will issue a warning in that case.
33 | Researchers can either accept the different \code{nstat}, or try again with a different \code{max.bin}.
34 | }
35 |
36 | \value{
37 | Returns a vector of positive integers (column heights), of the length \code{max.column * 2 + 1}.
38 | An object of this kind is expected in \code{\link{import.q.sorts}}, \code{\link{build.q.set}} and other convenience functions.
39 | }
40 |
41 | \author{Maximilian Held}
42 |
43 | \seealso{
44 | \code{\link{build.q.set}},
45 | \code{\link{import.q.sorts}}
46 | }
47 |
48 | \examples{
49 | ## Make Q distribution
50 | make.distribution(nstat=76, max.bin=7)
51 | }
52 |
--------------------------------------------------------------------------------
/man/plot.QmethodRes.Rd:
--------------------------------------------------------------------------------
1 | \name{plot.QmethodRes}
2 | \alias{plot.QmethodRes}
3 | \title{Q Method: plot for statement z-scores}
4 | \description{Takes an object of class \code{QmethodRes} resulting from \code{\link{qmethod}} and makes a dot-chart with the z-scores for statements and all factors.}
5 | \usage{
6 | \method{plot}{QmethodRes}(x, xlab = 'z-scores', ylab = 'statements',
7 | pchlist = NULL, colours = NULL,
8 | fnames = NULL, legend = TRUE,
9 | dist = TRUE, pchlist.fill = NULL,
10 | leg.pos="bottomright", xlim= NULL,
11 | sort.items=T, factors = NULL,
12 | ...)}
13 | \arguments{
14 | \item{x}{results object returned by \code{\link{qmethod}}.}
15 | \item{xlab}{label for x axis. Defaults to 'z-scores'.}
16 | \item{ylab}{label for y axis. Defaults to 'statements'.}
17 | \item{pchlist}{array of \code{pch} symbols to be used in plotting the points for each factor. Defaults to a pre-defined set of symbols.}
18 | \item{colours}{array of colours to be used when plotting the points for each perspective. Defaults to a pre-defined set of colours based on the \code{\link[grDevices]{rainbow}} palette.}
19 | \item{fnames}{names for factors to be used in the legend. In results where factor names have not been changed (using, e.g. \code{\link{q.fnames}}) it defaults to \code{'Factor 1'}, \code{'Factor 2'}, etc.}
20 | \item{legend}{logical; if \code{FALSE}, no \code{legend} will be drawn.}
21 | \item{dist}{Logical. Should distinguishing statements be indicated in the plot dots? If \code{TRUE}, then the z-score values that are distinguishing for a given statement and factor are represented with a different (filled) symbol.}
22 | \item{pchlist.fill}{List of symbols to indicate distinguishing statements. By default, this is set to \code{NULL}, which provides a set of symbols that coincides with those in \code{pchlist}, but filled.}
23 | \item{leg.pos}{Position of the legend.}
24 | \item{xlim}{Limits for the x axis, given as a vector of two numbers. If this is not provided, the limits are calculated from the sample.}
25 | \item{sort.items}{Whether and how the items are sorted in the vertical axis. Defaults to \code{TRUE}, which sorts the items according to the standard deviation of their z-scores for all factors; items of most disagreement are placed at the top. To invert this order (items of most disagreement at the bottom), set this argument to "consensus.top" A value of \code{FALSE} will not sort the items, and these are displayed in the same order as in the raw data. A numerical vector can also be provided in order to sort the statements manually: the vector needs to have the same length as the number of items, and provides the order in which the items are to be ordered.}
26 | \item{factors}{The factors to plot. Defaults to \code{NULL}, which plots all the factors in the object \code{x} in the order given. To print a subset of these factors or to print them in a different order, provide a numeric vector here with the factors and the order desired, e.g. \code{c(2,1)}}.
27 | \item{...}{other arguments for \code{\link[graphics]{plot}}.}
28 |
29 | }
30 |
31 | \author{Aiora Zabala}
32 |
33 | \seealso{
34 | \code{\link[graphics]{dotchart}} and \code{\link[graphics]{points}}.
35 | }
36 | \examples{
37 | data(lipset)
38 | results <- qmethod(lipset[[1]], nfactors = 3, rotation = "varimax")
39 | title <- "Q method z-scores, lipset dataset"
40 | subtitle <- paste0("Three factors, PCA, varimax. Printed on ",
41 | Sys.Date())
42 | plot(results, main = title, sub = subtitle)
43 |
44 | # Order the items in a different way
45 | plot(results, main = title, sub = subtitle,
46 | sort.items = c(rev(1:nrow(results$zsc))))
47 | }
48 | \keyword{plot}
49 |
50 | \note{
51 | The names of items to be plotted are taken from the matrix \code{x$zsc}.
52 |
53 | To change these names, change the row names in that matrix first, e.g.:
54 | \code{rownames(x$zsc) <- vector.of.item.names}.
55 |
56 | If the margin width is not enough to read the items, specify \code{par(mai=...)} first. See \code{\link[graphics]{par}} for details.
57 | }
58 |
59 | \references{
60 | This specific dotchart visualisation of Q results implemented in \code{\link{plot.QmethodRes}} was first developed and introduced in this R package, in preparation for the study published in \href{https://www.sciencedirect.com/science/article/abs/pii/S0921800916302683}{Zabala et al. (2017)}.
61 |
62 | \itemize{
63 | \item Zabala, A., 2014. qmethod: A Package to Explore Human Perspectives Using Q Methodology. \emph{The R Journal}, 6(2):163-173.\cr Available from: \url{https://journal.r-project.org/archive/2014-2/zabala.pdf}.
64 | \item Zabala, A., Pascual, U. and Garcia-Barrios, L. 2017. Payments for Pioneers? Revisiting the Role of External Rewards for Sustainable Innovation under Heterogeneous Motivations. \emph{Ecological Economics}, 135:234-245.\cr Available from: \url{https://www.sciencedirect.com/science/article/pii/S0921800916302683/}.
65 | }
66 |
67 | }
--------------------------------------------------------------------------------
/man/print.QmethodRes.Rd:
--------------------------------------------------------------------------------
1 | \name{print.QmethodRes}
2 | \alias{print.QmethodRes}
3 | \title{Q Method: print method for results}
4 | \description{Takes an object \code{QmethodRes} resulting from \code{\link{qmethod}} and prints it in a synthetic way.}
5 | \usage{
6 | \method{print}{QmethodRes}(x, length = 10, digits = 2, ...)}
7 | \arguments{
8 | \item{x}{an object of class \code{QmethodRes}.}
9 | \item{length}{maximum number of rows to print from the data frames within \code{QmethodRes}. Defaults to 10. Set to \code{NULL} to see the full results.}
10 | \item{digits}{minimum number of significant digits, see \code{\link[base]{print.default}.}}
11 | \item{...}{further arguments passed to or from other methods.}
12 | }
13 |
14 | \author{Aiora Zabala}
15 |
16 | \examples{
17 | data(lipset)
18 | results <- qmethod(lipset[[1]], nfactors = 3, rotation = "varimax")
19 | print(results, length = 5, digits = 1)
20 | }
21 | \keyword{print}
--------------------------------------------------------------------------------
/man/q.fnames.Rd:
--------------------------------------------------------------------------------
1 | \name{q.fnames}
2 | \alias{q.fnames}
3 | \title{Change factor names in the results of Q methodology analysis}
4 | \description{This function replaces the automatic names created in an object of Q method results returned by \code{\link{qmethod}}.}
5 | \usage{
6 | q.fnames(results, fnames)}
7 |
8 | \arguments{
9 | \item{results}{an object of class \code{QmethodRes}.}
10 | \item{fnames}{a vector with the names of the factors. The number of names provided has to match the number of factors extracted in the object \code{results}. The names cannot begin with a number. A limit of 50 characters is set, to avoid excessively wide columns. Names should ideally contain no spaces or symbols that are used for other purposes in R (e.g. '-', '+', '/' , ). However '.' are fine.}
11 | }
12 |
13 | \value{
14 | Returns the object \code{results} of class \code{QmethodRes}, with the new factor names.
15 | }
16 |
17 | \author{Aiora Zabala}
18 |
19 | \seealso{
20 | \code{\link{qmethod}}
21 | }
22 | \examples{
23 | data(lipset)
24 | results <- qmethod(lipset[[1]], nfactors = 3, rotation = "varimax")
25 | factor.names <- c("good", "bad", "ugly")
26 | results.renamed <- q.fnames(results, fnames = factor.names)
27 | results.renamed #shows all results
28 | }
29 |
--------------------------------------------------------------------------------
/man/qbstep.Rd:
--------------------------------------------------------------------------------
1 | \name{qbstep}
2 | \alias{qbstep}
3 | \title{Q Methodology: Single step for the bootstrap}
4 | \description{Bootstraping of Q methodology using PCA.}
5 | \usage{qbstep(subdata, subtarget, indet,
6 | nfactors, nqsorts, nstat,
7 | qmts = qmts, qmts_log = qmts_log,
8 | rotation = "unknown",
9 | flagged = flagged, cor.method="pearson", ...)}
10 |
11 | \arguments{
12 | \item{subdata}{resampled dataset of Q-sorts.}
13 | \item{subtarget}{target matrix, adapted to match the rows of the resampled dataset.}
14 | \item{indet}{method to solve the double indeterminacy issue when bootstrapping Principal Components Analysis (PCA). \code{"procrustes"} for procrustes rotation from \pkg{MCMCpack}, \code{"qindtest"} for simple solution valid for at least up to 3 factors extracted (see references), \code{"both"} for a \emph{\code{"qindtest"}} and a \emph{\code{"procrustes"}} rotation, or \code{"none"} for no solution. The latter is not recommended because it introduces inflated variability. If \code{"none"} is selected, each replication is rotated using the method set in \code{rotation}.}
15 | \item{nfactors}{number of factors in the study.}
16 | \item{nqsorts}{number of Q-sorts in the study.}
17 | \item{nstat}{number of statements in the study.}
18 | \item{qmts}{data frame with two rows and at least one column. This is automatically created when this function is called from \code{\link{qmboots}}(see \emph{Note} below).}
19 | \item{qmts_log}{data frame with two rows and at least one column. This is automatically created when this function is called from \code{\link{qmboots}}(see \emph{Note} below).}
20 | \item{rotation}{rotation method, defaults to \code{"none"}.}
21 | \item{flagged}{matrix or data frame of \code{nqsorts} rows and \code{nfactors} columns, with \code{TRUE} values for the Q-sorts that are flagged. Automatic flagging can be aplied using \code{\link{qflag}}. Manual flagging can be done by providing a logical matrix with \code{nqsorts} rows and \code{nfactors} columns to the argument \code{flagged}.}
22 | \item{cor.method}{character string indicating which correlation coefficient is to be computed, to be passed on to the function \code{\link[stats]{cor}}: \code{"pearson"} (default), \code{"kendall"}, or \code{"spearman"}. }
23 | \item{...}{other arguments to be passed on to \code{\link{qzscores}} or to \code{\link[psych]{principal}}.}
24 | }
25 |
26 | \value{
27 | \item{step_res}{summary of the analysis.}
28 | }
29 |
30 | \details{
31 | This function performs a single step within a bootstrap of Q methodology data. It takes one resample, performs the Q method analysis, checks for indeterminacy issues, and corrects them if necessary by calling the function \code{\link{qindtest}} or \code{\link{qpcrustes}}.
32 | }
33 |
34 | \author{Aiora Zabala}
35 |
36 | \note{This function is called within the function \code{\link{qmboots}}. Not intended to be used separately.}
37 |
38 | \seealso{
39 | \code{\link{qmethod}} and \code{\link{qmboots}} in this package.
40 | }
41 |
42 | \references{Zabala, Pascual (2016) Bootstrapping Q Methodology to Improve the Understanding of Human Perspectives. PLoS ONE 11(2): e0148087.}
43 |
44 | \keyword{multivariate}
45 | \keyword{Q methodology}
46 | \keyword{bootstrapping}
47 | \keyword{PCA}
48 |
--------------------------------------------------------------------------------
/man/qdc.Rd:
--------------------------------------------------------------------------------
1 | \name{qdc}
2 | \alias{qdc}
3 | \title{Q methodology: distinguishing and consensus statements}
4 | \description{Indicates the distinguishing and consensus statements. It does so by comparing the z-scores between each pair factors.}
5 | \usage{qdc(dataset, nfactors, zsc, sed)}
6 |
7 | \arguments{
8 | \item{dataset}{a matrix or a dataframe containing original data, with statements as rows, Q sorts as columns, and grid column values in each cell.}
9 | \item{nfactors}{number of factors extracted.}
10 | \item{zsc}{a matrix or a dataframe with the factor z-scores for statements resulting from \code{\link{qzscores}}.}
11 | \item{sed}{a matrix or a dataframe with the standard error of differences resulting from \code{\link{qfcharact}}.}
12 | }
13 |
14 | \details{
15 | Finds the distinguishing and consensus statements, based on the absolute differences between factor z-scores being larger than the standard error of differences (SED, calculated in \code{\link{qfcharact}}) for a given pair of factors.
16 |
17 | Returns a single data frame with the differences in z-scores between each pair of factors and the variable \code{dist.and.cons}, indicating whether each statement is distinguishing or consensus and for which factor(s) it is distinguishing. These are the possible categories in the \code{dist.and.cons} variable:
18 | \itemize{
19 | \item Where all the comparisons between each pair of factors are significantly different at p-value < .05 the statement is labelled as \code{"Distinguishes all"}.
20 | \item Where the comparisons of a given factor with all other factors are significant at p-value < .05, and comparisons between all other factors are not significant, the statement is labeled as \code{"Distinguishes f*"}.
21 | \item Where none of the comparisons are significantly different, the statement is labeled as \code{"Consensus"}.
22 | \item Statements that have category \code{""} (empty) are not distinguishing for any of the factors in particularly. They distinguish one or more pairs of factors and the star indications may be inspected to understand their role.
23 | }
24 |
25 | Significant differences at p-values:
26 | \itemize{
27 | \item {p >= 0.05 <- \code{""} (i.e. nothing)}
28 | \item {p < 0.05 <- \code{"*"}}
29 | \item {p < 0.01 <- \code{"**"}}
30 | \item {p < 0.001 <- \code{"***"}}
31 | \item {p < 0.000001 <- \code{"6*"}}
32 | }
33 |
34 | }
35 |
36 | \references{Brown, S. R., 1980 \emph{Political subjectivity: Applications of Q methodology in political science}, New Haven, CT: Yale University Press.
37 |
38 | See further references on the methodology in \code{\link{qmethod-package}}.}
39 |
40 | \note{This is a function used within \code{\link{qmethod}}. Rarely to be used independently.}
41 |
42 | \author{Aiora Zabala}
43 |
44 | \examples{
45 | data(lipset)
46 | results <- qmethod(lipset[[1]], nfactors = 3, rotation = "varimax")
47 | sed <- as.data.frame(results[[7]][[3]])
48 | zsc <- results[[5]]
49 | qdc(lipset[[1]], nfactors = 3, zsc = zsc, sed = sed)
50 | }
--------------------------------------------------------------------------------
/man/qdc.zsc.Rd:
--------------------------------------------------------------------------------
1 | \name{qdc.zsc}
2 | \alias{qdc.zsc}
3 | \title{Q methodology: distinguishing and consensus statements}
4 | \description{Extracts the z-score of distinguishing statements, in order to plot.}
5 | \usage{qdc.zsc(results)}
6 |
7 | \arguments{
8 | \item{results}{an object of class \code{QmethodRes}.}
9 | }
10 |
11 | \note{This is a function used within \code{\link{plot.QmethodRes}}. Rarely to be used independently.}
12 |
13 | \author{Aiora Zabala}
14 |
15 | \examples{
16 | data(lipset)
17 | results <- qmethod(lipset[[1]], nfactors = 3, rotation = "varimax")
18 | qdc.zsc(results)
19 | }
--------------------------------------------------------------------------------
/man/qfcharact.Rd:
--------------------------------------------------------------------------------
1 | \name{qfcharact}
2 | \alias{qfcharact}
3 | \title{Q methodology: factor characteristics}
4 | \description{Calculates the general factor characteristics: number of flagged Q-sorts, composite reliability, standard errors of factor scores, and comparisons between factors.}
5 | \usage{qfcharact(loa, flagged, zsc, nfactors, av_rel_coef = 0.8)}
6 |
7 | \arguments{
8 | \item{loa}{matrix or data frame of as many rows as Q-sorts (\code{nqsorts}) and \code{nfactors} columns, with values of factor loadings for Q-sorts, calculated using, e.g., \code{principal(...)$loadings}.}
9 | \item{flagged}{matrix or data frame of type \emph{logical}, indicating which Q-sorts are flagged for each factor. Provided manually or automatically using \code{\link{qflag}}.}
10 | \item{zsc}{a data frame with the z-scores for statements, calculated using \code{\link{qzscores}}.}
11 | \item{nfactors}{number of factors extracted.}
12 | \item{av_rel_coef}{average reliability coefficient (the individual variability of a respondent), set by default as 0.8.}
13 | }
14 |
15 | \value{
16 | Returns a list with three objects:
17 | \item{characteristics}{data frame with the following values for each factor:
18 | \itemize{
19 | \item{\code{"av_rel_coef"}: average reliability coefficient.}
20 | \item{\code{"nload"}: number of loading Q-sorts.}
21 | \item{\code{"eigenvals"}: eigenvalues.}
22 | \item{\code{"expl_var"}: percentage of explained variance.}
23 | \item{\code{"reliability"}: composite reliability.}
24 | \item{\code{"se_fscores"}: standard error of factor scores (SE).}
25 | }
26 | }
27 | \item{cor_zsc}{matrix of correlation coefficients between factors z-scores.}
28 | \item{sd_dif}{matrix of standard errors of differences (SED).}
29 | }
30 | \references{Brown, S. R., 1980 \emph{Political subjectivity: Applications of Q methodology in political science}, New Haven, CT: Yale University Press.
31 |
32 | See further references on the methodology in \code{\link{qmethod-package}}.}
33 |
34 | \note{This is a function used within \code{\link{qzscores}}. Rarely to be used independently.}
35 |
36 | \author{Aiora Zabala}
--------------------------------------------------------------------------------
/man/qflag.Rd:
--------------------------------------------------------------------------------
1 | \name{qflag}
2 | \alias{qflag}
3 | \title{Q methodology: automatic flagging of Q-sorts}
4 | \description{Applies the two standard algorithms to pre-flag Q-sorts automatically, for posterior calculation of the statement scores.}
5 | \usage{qflag(loa, nstat)}
6 |
7 | \arguments{
8 | \item{loa}{a Q-sort factor loading matrix obtained, for example from\cr \code{unclass(\link[psych]{principal}(...)$loadings)}, or from \code{\link{qmethod}(...)$loa}.}
9 | \item{nstat}{number of statements in the study.}
10 | }
11 | \details{
12 | These are the two standard criteria for automatic flagging used in Q method analysis:
13 | \enumerate{
14 | \item{Q-sorts which factor loading is higher than the threshold for p-value < 0.05, and}
15 | \item{Q-sorts which square loading is higher than the sum of square loadings of the same Q-sort in all other factors.}
16 | }
17 | Returns a logical matrix with Q-sorts as rows, and factors as columns.
18 |
19 | The function also runs two checks: Q-sorts flagged that have negative loadings and Q-sorts flagged in more than one factor. If any of these is true, the function returns a warning for the user to inspect the automatic pre-flagging (which should be done in all cases, but particularly in these ones). To conduct manual flagging, see guidelines here: \url{http://aiorazabala.github.io/qmethod/Advanced-analysis}
20 | }
21 |
22 | \references{Brown, S. R., 1980 \emph{Political subjectivity: Applications of Q methodology in political science}, New Haven, CT: Yale University Press.
23 |
24 | Van Exel, J., de Graaf, G., Rietveld, P., 2011. "'I can do perfectly well without a car!'" \emph{Transportation} 38, 383-407 (Page 388, footnote 8).
25 |
26 | See further references on the methodology in \code{\link{qmethod-package}}.}
27 |
28 | \note{This is a function used within \code{\link{qmethod}}. Rarely to be used independently.}
29 |
30 | \author{Aiora Zabala}
31 |
32 | \examples{
33 | data(lipset)
34 | library(psych)
35 | loa <- unclass(principal(lipset[[1]], nfactors = 3,
36 | rotate = "varimax")$loadings)
37 | flagged <- qflag(loa = loa, nstat = nrow(lipset[[1]]))
38 | summary(flagged)
39 |
40 | # Remember to manually inspect the automatic pre-flagging:
41 | results=list(loa=loa, flagged=flagged, brief=list(nfactors = ncol(loa)))
42 | loa.and.flags(results)
43 |
44 | }
--------------------------------------------------------------------------------
/man/qfsi.Rd:
--------------------------------------------------------------------------------
1 | \name{qfsi}
2 | \alias{qfsi}
3 | \title{Q Methodology: Factor Stability index}
4 | \description{Calculates a Factor Stability index and a Normalised Factor Stability index to bootstrapped Q method results (experimental).}
5 | \usage{qfsi(nfactors, nstat, qscores, zsc_bn, qm)}
6 |
7 | \arguments{
8 | \item{nfactors}{number of factors to extract.}
9 | \item{nstat}{number of statements in the study.}
10 | \item{qscores}{all possible factor score values in the Q grid distribution.}
11 | \item{zsc_bn}{bootstrapped factor scores.}
12 | \item{qm}{original Q method results from \code{\link{qmethod}} function.}
13 | }
14 | \details{
15 | Applies the Factor Stability index to a bootstrapped Q method results. Returns a data frame with two variables and as many rows as factors extracted. The first variable is the raw Factor Stability index. The second variable is the Normalised Factor Stability index which ranges from 0 to 1.
16 | }
17 |
18 | \author{Aiora Zabala}
19 |
20 | \seealso{
21 | \code{\link{qmboots}}.
22 | }
23 | \note{IMPORTANT: This function is experimental. Please contact the author for details.}
24 | \examples{
25 | data(lipset)
26 | boots <- qmboots(lipset[[1]], nfactors=3, nsteps=10,
27 | rotation="varimax", indet="qindtest",
28 | fsi=FALSE)
29 | fsi <- qfsi(nfactors=3, nstat=33, qscores=boots[[6]],
30 | zsc_bn=boots[[1]][[1]], qm=boots[[5]])
31 | fsi
32 | }
33 |
34 | \keyword{Q methodology}
35 |
--------------------------------------------------------------------------------
/man/qindtest.Rd:
--------------------------------------------------------------------------------
1 | \name{qindtest}
2 | \alias{qindtest}
3 | \title{Q Methodology: PCA bootstrap indeterminacy tests}
4 | \description{This is a simple test and implementation of the 'reordering-reflection' solution for the indeterminacy problem (alignment problem) when bootstrapping Principal Components Analysis (PCA) that causes factor order swaps and factor sign swaps.}
5 | \usage{qindtest(loa, target, nfactors)}
6 |
7 | \arguments{
8 | \item{loa}{data frame with factor loadings from the subsample analysis.}
9 | \item{target}{data frame with factor loadings from the full sample analysis, excluding qsorts that are not present in the bootstrap step.}
10 | \item{nfactors}{number of factors extracted.}
11 | }
12 |
13 | \details{This function tests whether there is any or both of the indeterminacy issues in bootstrapped PCA factor loading values. For testing, it looks at correlation coefficients between the target factor loadings and the bootstrapped factor loadings for each factor.
14 |
15 | First, if \emph{factor swap} is detected (Is the absolute value of diagonal coefficients bigger than non-diagonal coefficients for the same factor?) and it is only between two factors, these are swaped. After, the test is again performed to ensure that there is no need for further swaps. If the test fails, then the original factor loadings are recovered and the failure is reported. If the need for factor swap is detected for 1, 3 or more factors, this is reported and left unresolved. This is because an algorithm to determine which factors should swap with which has not been implemented.
16 |
17 | Second, \emph{sign swap} is tested for (Are all diagonal coefficients positive?). If it is detected, then the sign of factor loadings is shifted. This is not tested again afterwards, for it is given for granted that swaping signs will solve the issue.}
18 | \value{
19 | \item{qindtest}{returns a list with three data frames: the factor loadings of the corrected bootstrap step, results from order swap and sign swap tests, and report of errors.}
20 | }
21 |
22 | \note{this function is called within the function \code{\link{qmboots}}. Not intended to be used separately.}
23 |
24 | \references{Zabala, Pascual (2016) Bootstrapping Q Methodology to Improve the Understanding of Human Perspectives. PLoS ONE 11(2): e0148087.
25 |
26 | See also:
27 |
28 | Timmerman, M.E., Kiers, H. a L., Smilde, A.K., 2007. Estimating confidence intervals for principal component loadings: a comparison between the bootstrap and asymptotic results. The British journal of mathematical and statistical psychology 60, 295-314.
29 |
30 | Zhang, G., Preacher, K.J., Luo, S., 2010. Bootstrap Confidence Intervals for Ordinary Least Squares Factor Loadings and Correlations in Exploratory Factor Analysis. Multivariate Behavioral Research 45, 104-134.
31 | }
32 |
33 | \author{Aiora Zabala}
34 |
35 | \examples{
36 | data(lipset)
37 | nf <- 3
38 |
39 | # 1. Create target matrix
40 | qm <- qmethod(lipset[[1]], nfactors = nf, rotation = "varimax")
41 |
42 | # 2. Resample
43 | qselim <- sample(1:3, 2, replace = FALSE) ##q sorts to eliminate
44 | subdata <- lipset[[1]][ , -qselim]
45 |
46 | # 3. Calculate factor loadings with the resample
47 | library(psych)
48 | loa <- as.data.frame(unclass(principal(subdata,
49 | nfactors = nf, rotate = "varimax")$loadings))
50 |
51 | # 4. Reorder target matrix
52 | target <- as.matrix(as.data.frame(qm[3]))
53 | colnames(target) <- paste0("target_f", 1:nf)
54 | subtarget <- target[c(-qselim),]
55 |
56 | # 5. Apply test and solution for indeterminacy issue
57 | qindt <- qindtest(loa, subtarget, nf)
58 | qindt
59 | }
60 |
61 | \keyword{PCA}
62 | \keyword{Q methodology}
63 | \keyword{indeterminacy}
64 | \keyword{bootstrapping}
--------------------------------------------------------------------------------
/man/qmb.plot.Rd:
--------------------------------------------------------------------------------
1 | \name{qmb.plot}
2 | \alias{qmb.plot}
3 | \title{Q Methodology: Plot of bootstrap results}
4 | \description{Plots the summary of bootstrap results, either z-scores or factor loadings.}
5 | \usage{qmb.plot(qmbsum, type = c("zsc", "loa"), nfactors,
6 | cex = 0.7, cex.leg = 0.8, errbar.col = "black",
7 | lwd = 1, lty = 1, vertdist = 0.2, limits = NULL,
8 | r.names = NA, sort = c("none", "difference", "sd"),
9 | sbset = NULL, leg.pos = "topleft",
10 | bty = "n", plot.std = TRUE, pch= NULL,
11 | col=NULL, grid.col="gray", ...)}
12 |
13 | \arguments{
14 | \item{qmbsum}{an object with the summary of bootstrap results, as produced by \code{\link{qmb.summary}}.}
15 | \item{type}{the subject to plot, either z-zcores of statements or factor loadings of Q-sorts.}
16 | \item{nfactors}{number of factors extracted.}
17 | \item{cex}{a numerical value giving the amount by which plotting text and symbols should be magnified relative to the default (see \code{\link[graphics]{par}}).)}
18 | \item{cex.leg}{a numerical value giving the amount by which the legend should be magnified relative to \code{cex}.)}
19 | \item{errbar.col}{colour used for the error bars. Defaults to \code{"black"}.}
20 | \item{lwd}{line width (see \code{\link[graphics]{par}}).}
21 | \item{lty}{line type (see \code{\link[graphics]{par}}).}
22 | \item{vertdist}{distance between the values for each factor.}
23 | \item{limits}{axis limits for the numerical values. If set to \code{NULL}, the limits are automatically set as \code{c(-1, 1)} when \code{type = "loa"}, and as the minimum and maximum values of z-scores (including the error bars) when \code{type = "zsc"}}
24 | \item{r.names}{names of the items to be printed in the axis ticks(either Q-sorts when \code{type = "loa"}, or statements when \code{type = "zsc"}). When the value is \code{NULL}, it defaults to \code{rownames}.}
25 | \item{sort}{ordering of the items in the axis. If set to \code{"none"}, items are ordered by the default order in the dataset. If set to \code{"difference"}, items are ordered according to the variability in the values across factors. If set to \code{"sd"}, items are ordered according to the sum of the errors obtained in the bootstrap.}
26 | \item{sbset}{How many items are to be printed? When the value is \code{NULL}, it plots all the items.}
27 | \item{leg.pos}{Position of the legend.}
28 | \item{bty}{Legend box (see \code{\link[graphics]{legend}}).}
29 | \item{plot.std}{logical value. When set to \code{TRUE} (default), it prints the points for values obtained with the standard analysis (non bootstrapped).}
30 | \item{pch}{plotting symbols. Defaults to \code{NULL}, in which case the symbols are selected automatically. If provided, the vector needs to contain at least as many elements as number of factors. In addition, if argument \code{plot.std == TRUE} (default) the vector needs to contain at least double as many elements as vectors, in order to extract (a) the plotting symbols for bootstrapped values (the first elements) and (b) the plotting symbols for standard values (the next elements).}
31 | \item{col}{colours for the points. At least as many elements as number of factors have to be provided.}
32 | \item{grid.col}{colour of the grid.}
33 | \item{...}{additional arguments to be passed to the functions \code{\link[graphics]{dotchart}}, \code{\link[graphics]{mtext}}, \code{\link[graphics]{segments}}, \code{\link[graphics]{points}}, \code{\link[graphics]{abline}} or \code{\link[graphics]{legend}}.}
34 | }
35 |
36 | \author{Aiora Zabala}
37 |
38 | \references{Zabala, Pascual (2016) Bootstrapping Q Methodology to Improve the Understanding of Human Perspectives. PLoS ONE 11(2): e0148087.}
39 |
40 | \seealso{
41 | \code{\link{qmethod}}, \code{\link{qmboots}}, \code{\link{qmb.summary}}
42 | }
43 | \examples{
44 | data(lipset)
45 | boots <- qmboots(lipset[[1]], nfactors = 3, nsteps = 50,
46 | load = "auto", rotation = "varimax",
47 | indet = "qindet", fsi = TRUE)
48 |
49 | boots.summary <- qmb.summary(boots)
50 |
51 | qmb.plot(boots.summary, 3, type = "loa", sort="difference")
52 | }
53 | \keyword{Q methodology}
54 | \keyword{bootstrapping}
55 | \keyword{plot}
56 |
--------------------------------------------------------------------------------
/man/qmb.summary.Rd:
--------------------------------------------------------------------------------
1 | \name{qmb.summary}
2 | \alias{qmb.summary}
3 | \title{Q Methodology: Summary of bootstrap results}
4 | \description{Summarises bootstrap results for Q-sorts and statements into two tables.}
5 | \usage{qmb.summary(qmboots)}
6 |
7 | \arguments{
8 | \item{qmboots}{an object of bootstrap results, as produced by \code{\link{qmboots}}.}
9 | }
10 |
11 | \value{
12 | Returns a list with two data frames:
13 | \item{qsorts}{data frame with Q-sort as rows, and the following columns: the factor loadings from the standard analysis (*.std), the bootstrap (*.loa), the bootstrap SE (*.SE), the frequency of flagging (*.freq*) and the estimate of bias (*.bias).}
14 | \item{statements}{data frame with statements as rows, and the following columns: the z-scores from the standard analysis (*.std), from the bootstrap (*.bts), bootstrap SE (*.SE), estimate of bias of z-scores (*.bias), factor scores from the standard analysis (fsc_f*), from the bootstrap (fsc.bts.*), estimate of bias of factor scores, distinguishing and consensus statements from the standard results (see \code{\link{qdc}}) and from the bootstrap values.}
15 | }
16 |
17 | \author{Aiora Zabala}
18 |
19 | \references{Zabala, Pascual (2016) Bootstrapping Q Methodology to Improve the Understanding of Human Perspectives. PLoS ONE 11(2): e0148087.}
20 |
21 | \seealso{
22 | \code{\link{qmethod}}, \code{\link{qmboots}}
23 | }
24 | \examples{
25 | data(lipset)
26 | boots <- qmboots(lipset[[1]], nfactors = 3, nsteps = 50,
27 | load = "auto", rotation = "varimax",
28 | indet = "qindet", fsi = TRUE)
29 |
30 | boots.summary <- qmb.summary(boots)
31 |
32 | # First rows of the summary for Q-sorts:
33 | head(boots.summary$qsorts)
34 |
35 | # First rows of the summary for statements:
36 | head(boots.summary$statements)
37 | }
38 | \keyword{Q methodology}
39 | \keyword{bootstrapping}
40 | \keyword{summary}
41 |
--------------------------------------------------------------------------------
/man/qmboots.Rd:
--------------------------------------------------------------------------------
1 | \name{qmboots}
2 | \alias{qmboots}
3 | \title{Q Methodology: Bootstrap}
4 | \description{Implementation of the bootstrap to Q methodology using Principal Components Analysis (PCA).}
5 | \usage{qmboots(dataset, nfactors, nsteps, load = "auto",
6 | rotation = "varimax", indet = "qindtest", fsi = TRUE,
7 | forced = T, distribution = NULL,
8 | cor.method="pearson", ...)}
9 |
10 | \arguments{
11 | \item{dataset}{a matrix or dataframe containing original data, with statements as rows, Q sorts as columns, and Q board column values in each cell.}
12 | \item{nfactors}{number of factors to extract using PCA.}
13 | \item{load}{a matrix of factor loadings to be used as target. If "auto", the target matrix is generated using the rotation indicated ("varimax" by default).}
14 | \item{nsteps}{number of steps (repetitions) for the bootstraping.}
15 | \item{rotation}{rotation method, set to "varimax" by default. Other possible rotations from \pkg{psych} \code{\link[psych]{principal}} function "none", "varimax", "quatimax", "promax", "oblimin", "simplimax", and "cluster" are possible.}
16 | \item{indet}{method to solve the double indeterminacy issue in PCA bootstrapping. \code{"procrustes"} for procrustes rotation, \code{"qindtest"} for simple solution valid for up to 3 factors extracted, \code{"both"} for a qindtest and a procrustes rotation, or \code{"none"} for no rotation. The latter is not recommended for it introduces inflated variability. If \code{"none"} is selected, each replication is rotated using varimax.}
17 | \item{fsi}{logical; Shall the Factor Stability index be calculated? (experimental index).}
18 | \item{forced}{logical; Is the ranking of the items forced to match the distributions? Set to \code{TRUE} if all respondents ranked the items strictly following the distribution scores, in which case the values of the distribution are calculated automatically. Set to \code{FALSE} if respondents had the possibility to rank the items without following the distribution, and the values of the distribution have to be provided as an array in the argument \code{distribution}.}
19 | \item{distribution}{logical; when forced = \code{FALSE}, the distribution has to be provided as a vector of numbers, such as \code{c(-2, -1, -1, 0, 1, 1, 2, 2)}.}
20 | \item{cor.method}{character string indicating which correlation coefficient is to be computed, to be passed on to the function \code{\link[stats]{cor}}: \code{"pearson"} (default), \code{"kendall"}, or \code{"spearman"}. }
21 | \item{...}{Other arguments passed on to \code{\link{qmethod}}.}
22 | }
23 |
24 | \value{
25 | \item{zscore-stats}{summary of the analysis. List of one object, plus as many objects as factors extracted: the bootstrapped factor scores, and the z-score statistics of the bootrstrap. The z-score statistics of interest are \code{mean} (the bootstrap estimate of the z-score), and \code{sd} (the bootstrap estimate of the SE).}
26 | \item{full.bts.res}{full bootstrap results. List with as many objects as factors extracted, each object containing three data frames: \code{flagged}, \code{zsc} and \code{loa}. These data frames have as many columns as bootstrap steps, and contain the results of the analysis of each iteration. See description of these three data frames in \code{\link{qmethod}}.}
27 | \item{indet.tests}{indeterminacy tests.}
28 | \item{resamples}{index of the Q-sorts selected for each step.}
29 | \item{orig.res}{original results. See details of all the objects in \code{\link{qmethod}}.}
30 | \item{q.array}{array of values in the distribution grid.}
31 | \item{loa.stats}{statistics of factor loadings. List with as many objects as factors extracted, each object containing one data frame with the factor loading statistics of the bootrstrap. The factor loading statistics of interest are \code{mean} (the bootstrap estimate of the factor loading), and \code{sd} (the bootstrap estimate of the SE). This table includes \code{flag_freq}, which indicates the frequency with which the given Q-sort was flagged for the given factor.}
32 | \item{q.array}{array of values in the distribution grid.}
33 | \item{fsi}{factor stability index (optional; experimental).}
34 | }
35 | \references{Zabala, Pascual (2016) Bootstrapping Q Methodology to Improve the Understanding of Human Perspectives. PLoS ONE 11(2): e0148087.}
36 |
37 | \author{Aiora Zabala}
38 |
39 | \seealso{
40 | \code{\link{qmethod}}
41 | }
42 | \examples{
43 | data(lipset)
44 | boots <- qmboots(lipset[[1]], nfactors = 3, nsteps = 10, load = "auto",
45 | rotation = "varimax", indet = "qindtest",
46 | fsi = TRUE)
47 | boots
48 | boxplot(t(boots[[2]][[1]][[2]]), horizontal = TRUE,
49 | main = "Statement z-score boxplot for the first factor", las = 1)
50 |
51 | #See the table summaries:
52 | qms <- qmb.summary(boots)
53 | round(qms$statements, digits=2) # statements
54 | round(qms$qsorts, digits=2) # Q-sorts
55 |
56 | # A more synthetic visualisation:
57 | # z-scores:
58 | qmb.plot(qms, nfactors=3, type="zsc", sort="difference")
59 | # factor loadings:
60 | qmb.plot(qms, nfactors=3, type="loa", sort="difference")
61 |
62 |
63 | }
64 | \keyword{multivariate}
65 | \keyword{Q methodology}
66 | \keyword{bootstrapping}
67 | \keyword{PCA}
68 |
--------------------------------------------------------------------------------
/man/qpcrustes.Rd:
--------------------------------------------------------------------------------
1 | \name{qpcrustes}
2 | \alias{qpcrustes}
3 | \title{Q Methodology: Procrustes rotation of loadings}
4 | \description{This is a wrap of \code{procrustes} rotation from \pkg{MCMCpack} for bootstrapping Q methodology in the function \code{\link{qmboots}}.}
5 | \usage{qpcrustes(loa, target, nfactors)}
6 |
7 | \arguments{
8 | \item{loa}{factor loadings from the analysis of a resample.}
9 | \item{target}{factor loadings from the analysis of a subsample.}
10 | \item{nfactors}{fumber of factors}
11 | }
12 |
13 | \details{Returns the factor loadings for the subsample after applying Procrustes rotation to correct the indeterminacy issue. Use \code{procrustes} from \pkg{MCMCpack}. Used within the function \code{\link{qmboots}}, not intended for independent use.
14 | }
15 |
16 | \references{Zabala, Pascual (2016) Bootstrapping Q Methodology to Improve the Understanding of Human Perspectives. PLoS ONE 11(2): e0148087.}
17 |
18 | \author{Aiora Zabala}
19 |
20 | \note{this function is called within the function \code{\link{qmboots}}. Not intended to be used separately. The function calls \code{procrustes} from \pkg{MCMCpack}, a package that requires the package \code{graph}. As from April 2016 the package has been moved to Bioconductor, and therefore it needs to be installed manually. If you get errors of missing packages when using this function or \code{\link{qmboots}}, install \code{graph} manually:
21 | \code{source("https://bioconductor.org/biocLite.R")
22 | biocLite("graph")}
23 | }
24 |
25 | \seealso{
26 | Function \code{procrustes} from \pkg{GPArotation} package.
27 | }
28 | \examples{
29 | # This example requires installing 'MCMCpack':
30 | data(lipset)
31 | qm <- qmethod(lipset[[1]], nfactors=3, rotation="varimax")
32 | qselim <- sample(1:3, 2, replace=FALSE) ##q sorts to eliminate
33 | subdata <- lipset[[1]][ , -qselim]
34 | library(psych)
35 | loa <- as.data.frame(unclass(principal(subdata,
36 | nfactors=3, rotate="varimax")$loadings))
37 | target <- as.matrix(as.data.frame(qm[3]))
38 | colnames(target) <- paste("target_f", 1:3, sep="")
39 | subtarget <- target[c(-qselim),]
40 | qindt <- qpcrustes(loa, subtarget, 3)
41 | qindt
42 | }
43 |
44 | \keyword{multivariate}
45 | \keyword{Q methodology}
46 | \keyword{Procrustes rotation}
47 |
--------------------------------------------------------------------------------
/man/qzscores.Rd:
--------------------------------------------------------------------------------
1 | \name{qzscores}
2 | \alias{qzscores}
3 | \title{Q methodology: z-scores from loadings}
4 | \description{Calculates factor characteristics, z-scores, and factor scores, provided a matrix of loadings and a matrix of (manually or automatically) flagged Q-sorts.}
5 | \usage{qzscores(dataset, nfactors, loa, flagged, forced = TRUE,
6 | distribution = NULL)}
7 |
8 | \arguments{
9 | \item{dataset}{a matrix or a data frame containing raw data, with statements as rows, Q-sorts as columns, and the column scores in the distribution in each cell.}
10 | \item{nfactors}{number of factors to extract.}
11 | \item{loa}{matrix or data frame of \code{nqsorts} rows and \code{nfactors} columns, with values of factor loadings for Q-sorts, calculated using, e.g., \code{principal(...)$loadings} or \code{\link{centroid}}.}
12 | \item{flagged}{matrix or data frame of \code{nqsorts} rows and \code{nfactors} columns, with \code{TRUE} values for the Q-sorts that are flagged. Automatic flagging can be aplied using \code{\link{qflag}}. Manual flagging can be done by providing a logical matrix with \code{nqsorts} rows and \code{nfactors} columns to the argument \code{flagged}.}
13 | \item{forced}{logical; Is the distribution of items forced? Set to \code{TRUE} if all respondents ranked the items following strictly the distribution scores, and the values of the distribution are calculated automatically. Set to \code{FALSE} if respondents were able to rank the items without following the distribution, and the values of the distribution have to be provided as an array in the argument \code{distribution}.}
14 | \item{distribution}{logical; when \code{forced = FALSE}, the distribution has to be provided as a vector of numbers, such as \code{c(-2, -1, -1, 0, 1, 1, 2, 2)}.}
15 | }
16 |
17 | \details{In order to implement manual flagging, use a manually created data frame (or matrix) for \code{flagged}. See an example of code to perform manual flagging or to manipulate the loadings in \href{http://aiorazabala.github.io/qmethod/Advanced-analysis}{the website}.
18 |
19 | The loadings from \code{principal(...)$loadings} or \code{centroid} can be explored to decide upon flagging. The \code{loa} data frame should have Q-sorts as rows, and factors as columns, where \code{TRUE} are the flagged Q-sorts.}
20 | \value{
21 | Returns a list of class \code{QmethodRes}, with seven objects:
22 | \item{brief}{a list with the basic values of the analysis: date (\code{"date"}), number of statements (\code{"nstat"}), number of Q-sorts (\code{"nqsort"}), whether the distribution was 'forced' (\code{"distro"}), number of factors extracted (\code{"nfactors"}), type of extraction (\code{"extraction"}), type of rotation (\code{"rotation"}), method for correlation (\code{"cor.method"}), and a summary of this information for display purposes (\code{"info"}).}
23 | \item{dataset}{original data.}
24 | \item{loa}{factor loadings for Q-sorts.}
25 | \item{flagged}{logical dataframe of flagged Q-sorts.}
26 | \item{zsc}{statements z-scores.}
27 | \item{zsc_n}{statements rounded scores, rounded to the values in the first row of the original dataset.}
28 | \item{f_char}{factor characteristics obtained from \code{\link{qfcharact}}.}
29 | }
30 | \references{Brown, S. R., 1980 \emph{Political subjectivity: Applications of Q methodology in political science}, New Haven, CT: Yale University Press.
31 |
32 | See further references on the methodology in \code{\link{qmethod-package}}.}
33 |
34 | \note{This is a function used within \code{\link{qmethod}}. Rarely to be used independently.}
35 |
36 | \author{Aiora Zabala}
37 |
38 | \examples{
39 | data(lipset)
40 | library(psych)
41 | loa <- unclass(principal(lipset[[1]],
42 | nfactors = 3, rotate = "varimax")$loadings)
43 | flagged <- qflag(nstat = 33, loa = loa)
44 | qmzsc <- qzscores(lipset[[1]], nfactors = 3, flagged = flagged, loa = loa)
45 | qmzsc # Show results
46 | }
47 |
--------------------------------------------------------------------------------
/man/runInterface.Rd:
--------------------------------------------------------------------------------
1 | \name{runInterface}
2 | \alias{runInterface}
3 | \title{Q methodology: Graphical User Interface (GUI)}
4 | \description{Launch an interactive interface to run Q methodology analysis using the basic features.
5 | The interface is also [available online](https://azabala.shinyapps.io/qmethod-gui/).}
6 |
7 | \usage{runInterface()}
8 |
9 | \details{
10 | This GUI allows the user to conduct a full Q methodology analysis, choosing:
11 | \itemize{
12 | \item {either PCA or centroid extraction method}
13 | \item {varimax or no rotation method (for PCA and centroid) and other uncommon rotation methods (for PCA)}
14 | \item {selecting from 2 to 7 factors/components.}
15 | }
16 | The GUI conducts analysis with forced distribution and automatic flagging. See Note.
17 |
18 | The GUI shows the full results from the analysis, and also:
19 | \itemize{
20 | \item{Plot of z-scores}
21 | \item{Automatically flagged Q-sorts}
22 | \item{Information to explore how many factors to extract (including a screeplot)}
23 | \item{Plot of z-scores}
24 | }
25 | }
26 |
27 | \note{
28 | This GUI has limited functionality in comparison to that through the command-line. For full functionality (such as specifying non-forced analysis, manual flagging, and much more), use the command-line directly in the R console. See, for example, a tutorial for \href{http://aiorazabala.github.io/qmethod/Advanced-analysis}{manual manipulation of Q-sort loadings and/or manual flagging}.
29 |
30 | To run this same analysis directly in R, see the code generated in the GUI in \emph{Run the analysis directly in R}.
31 | }
32 |
33 | \examples{
34 | ## Only run this example in interactive R sessions
35 | if (interactive()) {
36 | runInterface()
37 | }
38 | }
--------------------------------------------------------------------------------
/man/summary.QmethodRes.Rd:
--------------------------------------------------------------------------------
1 | \name{summary.QmethodRes}
2 | \alias{summary.QmethodRes}
3 | \title{Q methodology: summary for class 'QmethodRes'}
4 | \description{Shows a summary of the results of Q methodology from the \code{\link{qmethod}} function: factor scores and factor characteristics.}
5 | \usage{
6 | \method{summary}{QmethodRes}(object, ...)
7 | }
8 |
9 | \arguments{
10 | \item{object}{an object of class \code{QmethodRes} created after \code{\link{qmethod}} function.}
11 | \item{...}{any other argument for the \code{\link{summary}} function.}
12 | }
13 | \value{
14 | Returns the summary of the analysis:
15 | \itemize{
16 | \item Statements factor scores normalized to the values in the first row of the original dataset, and
17 | \item Factor characteristics: Average reliability coefficient, Number of loading Q-sorts, Eigenvalues, Percentage of explained variance, Composite reliability, Standard error of factor scores, Correlation coefficients between factors z-scores, Standard errors of differences
18 | }
19 | }
20 | \references{Brown, S. R., 1980 \emph{Political subjectivity: Applications of Q methodology in political science}, New Haven, CT: Yale University Press.}
21 |
22 | \author{Aiora Zabala}
23 |
24 | \seealso{
25 | \code{\link{qmethod}} in this package
26 | }
27 | \examples{
28 | data(lipset)
29 | results <- qmethod(lipset[[1]], nfactors = 3, rotation = "varimax")
30 | summary(results)
31 | }
--------------------------------------------------------------------------------