Example: biology

How To: Use the psych package for Factor Analysis and data ...

How To: Use the psych package for Factor Analysis and datareductionWilliam RevelleDepartment of PsychologyNorthwestern UniversityDecember 30, 2018 Contents1 Overview of this and related Jump starting thepsychpackage a guide for the impatient ..42 Overview of this and related documents73 Getting started74 Basic data Data input from a local or remote file .. Data input from the clipboard .. Basic descriptive statistics .. Simple descriptive graphics .. Plot Matrices .. structure .. displays of correlational structure .. Polychoric, tetrachoric, polyserial, and biserial correlations ..135 Item and scale Dimension reduction through Factor Analysis and cluster Analysis .. Residual Factor Analysis .. Axis Factor Analysis .. Least Squares Factor Analysis .

Psychometric applications emphasize techniques for dimension reduction including factor analysis, cluster analysis, and principal components analysis. The fa function includes ve methods of factor analysis (minimum residual, principal axis, weighted least squares, generalized least squares and maximum likelihood factor analysis). Determining ...

Tags:

  Analysis, Factors, Factor analysis

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of How To: Use the psych package for Factor Analysis and data ...

1 How To: Use the psych package for Factor Analysis and datareductionWilliam RevelleDepartment of PsychologyNorthwestern UniversityDecember 30, 2018 Contents1 Overview of this and related Jump starting thepsychpackage a guide for the impatient ..42 Overview of this and related documents73 Getting started74 Basic data Data input from a local or remote file .. Data input from the clipboard .. Basic descriptive statistics .. Simple descriptive graphics .. Plot Matrices .. structure .. displays of correlational structure .. Polychoric, tetrachoric, polyserial, and biserial correlations ..135 Item and scale Dimension reduction through Factor Analysis and cluster Analysis .. Residual Factor Analysis .. Axis Factor Analysis .. Least Squares Factor Analysis .

2 Components Analysis (PCA) .. and bi- Factor solutions .. Cluster Analysis : iclust .. Confidence intervals using bootstrapping techniques .. Comparing Factor /component/cluster solutions .. correlations .. Determining the number of dimensions to extract.. Simple Structure .. Analysis .. Factor extension .. Comparing multiple solutions ..426 Classical Test Theory and Reliability of a single scale .. Usingomegato find the reliability of a single scale .. Estimating husing Confirmatory Factor Analysis .. estimates of reliability .. Reliability and correlations of multiple scales within an inventory .. from raw data .. scales from a correlation matrix .. Scoring Multiple Choice Items .. Item Analysis ..657 Item Response Theory Factor Analysis and Item Response Theory.

3 Speeding up analyses .. IRT based scoring ..738 Multilevel Decomposing data into within and between level correlations Generating and displaying multilevel data ..779 Set Correlation and Multiple Regression from the correlation matrix7710 Simulation functions8011 Graphical Displays8212 Miscellaneous functions8213 Data sets8414 Development version and a users guide8615 Psychometric Theory86216 SessionInfo8631 Overview of this and related documentsTo do basic and advanced personality and psychological research usingRis not as compli-cated as some think. This is one of a set of How To to do various things usingR(R CoreTeam, 2018), particularly using thepsych(Revelle, 2018) current list of How To s includes:1. InstallingRand some useful packages2. UsingRand thepsychpackage to findomegahand UsingRand thepsychfor Factor Analysis and principal components Analysis .

4 (Thisdocument).4. Using to find scale scores and scale An overview (vignette) of thepsychpackageSeveral functions are meant to do multiple regressions, either from the raw data orfrom a variance/covariance matrix, or a correlation matrix. This is discussed in moredetail in6. How to do mediation and moderation Analysis usingmediateandsetCoris dis-cuseded in the mediation, moderation and regression Analysis Jump starting thepsychpackage a guide for the impatientYou have installedpsych(section 3) and you want to use it without reading much should you do?1. Activate thepsychpackage:R codelibrary( psych )2. Input your data (section ). Go to your friendly text editor or data manipulationprogram ( , Excel) and copy the data to the clipboard. Include a first line that hasthe variable labels.

5 Paste it intopsychusing :R codemyData <- ()\end{Rnput}\item Make sure that what you just read is right. Describe it (section~\ref{sect:describe}) and perhaps look at the first and last few lines:\begin{Rinput}4describe(myData)hea dTail(myData)3. Look at the patterns in the data. If you have fewer than about 10 variables, look atthe SPLOM (Scatter Plot Matrix) of the data (section ).R (myData)4. Find the correlations of all of your data. Descriptively (just the values) (section )R codelowerCor(myData) Graphically (section )R codecorPlot(r)5. Test for the number of factors in your data using parallel Analysis ( ,section ) or Very Simple Structure (vss, ) .R (myData)vss(myData)6. Factor analyze (see section ) the data with a specified number of factors (thedefault is 1), the default method is minimum residual, the default rotation for morethan one Factor is oblimin.

6 There are many more possibilities (see sections ).Compare the solution to a hierarchical cluster Analysis using the ICLUST algorithm(Revelle, 1979) (see section ). Also consider a hierarchical Factor solution to findcoefficient (see ). Yet another option is to do a series of Factor analyses inwhat is known as the bass akward procedure (Goldberg, 2006) which considers thecorrelation between factors at multiple levels of Analysis (see??).R codefa(myData)iclust(myData)omega(myData )bassAckward(myData)7. Some people like to find coefficient as an estimate of reliability. This may be donefor a single scale using thealphafunction (see ). Perhaps more useful is theability to create several scales as unweighted averages of specified items using thescoreIemsfunction (see ) and to find various estimates of internal consistency forthese scales, find their intercorrelations, and find scores for all the codealpha(myData) #score all of the items as part of one <- (nvar=20,list(first = c(1,-3,5,-7,8:10),second=c(2,4,-6,11:15, -16))) <- scoreItems(myKeys,myData) #form several #show the highlights of the resultsAt this point you have had a chance to see the highlights of thepsychpackage and todo some basic (and advanced) data Analysis .

7 You might find reading the entire overviewvignette helpful to get a broader understanding of what can be done inRusing that the help command (?) is available for every function. Try running theexamples for each help Overview of this and related documentsThepsychpackage (Revelle, 2018) has been developed at Northwestern University since2005 to include functions most useful for personality, psychometric, and psychological re-search. The package is also meant to supplement a text on psychometric theory (Revelle,prep), a draft of which is available of the functions ( , ,describe, , , , , ) are useful for basic data entry and descriptive applications emphasize techniques for dimension reduction including factoranalysis, cluster Analysis , and principal components Analysis . Thefafunction includesfive methods offactor Analysis (minimum residual,principal axis,weighted least squares,generalized least squaresandmaximum likelihoodfactor Analysis ).

8 Determining the num-ber of factors or components to extract may be done by using the Very Simple Structure(Revelle and Rocklin, 1979) (vss), Minimum Average Partial correlation (Velicer, 1976)(MAP) or parallel Analysis ( ) criteria. Item Response Theory (IRT) models fordichotomous or polytomous items may be found by factoringtetrachoricorpolychoriccorrelat ion matrices and expressing the resulting parameters in terms of location and dis-crimination Bifactor and hierarchical Factor structures may be estimated byusing Schmid Leiman transformations (Schmid and Leiman, 1957) (schmid) to transforma hierarchical Factor structure into abifactorsolution (Holzinger and Swineford, 1937).Scale construction can be done using the Item Cluster Analysis (Revelle, 1979) (iclust)function to determine the structure and to calculate reliability coefficients (Cronbach,1951)(alpha,scoreItems, ), (Revelle, 1979; Revelle and Zin-barg, 2009) (iclust) and McDonald s hand t(McDonald, 1999) (omega).

9 Guttman s sixestimates of internal consistency reliability (Guttman (1945), as well as additional estimates(Revelle and Zinbarg, 2009) are in theguttmanfunction. The six measures of Intraclasscorrelation coefficients (ICC) discussed by Shrout and Fleiss (1979) are also displays include Scatter Plot Matrix (SPLOM) plots , corre-lation heat maps ( ) Factor , cluster, and structural diagrams , , , as well as item response characteristics and itemand test information characteristic Getting startedSome of the functions described in this overview require other packages. Particularly usefulfor rotating the results of Factor analyses (from ,faorprincipal) or hierarchicalfactor models usingomegaorschmid, is theGPArotationpackage. These and other useful7packages may be installed by first installing and then using the task views (ctv) packageto install the Psychometrics task view, but doing it this way is not Basic data analysisA number ofpsychfunctions facilitate the entry of data and finding basic , to run any of thepsychfunctions, it is necessary to make the package activeby using thelibrarycommand:R codelibrary( psych )The other packages, once installed, will be called automatically is possible to automatically loadpsychand other functions by creating and then savinga.)

10 First function: ,R <- function(x) {library( psych )} Data input from a local or remote fileFind and read standard files This will open a search window for youroperating system which you can use to find the file. If the file has a suffix of .text, .txt,.TXT, .csv, ,dat, .data, .sav, .xpt, .XPT, .r, .R, .rds, .Rds, .rda, .Rda, .rdata, Rdata, , then the file will be opened and the data will be read in (or loaded in the case ofRda files)myData <- () # find the appropriate file using your normal operating systemAlternatively, if you have a file name for a remote file, you can read it <- (fn) # where file name is the the remote address of the Data input from the clipboardThere are of course many ways to enter data intoR. Reading from a local file perhaps the most preferred.


Related search queries