Questions tagged [psych]

An R package for analysing personality, psychometrics and experimental psychology. Do not use this tag for Ruby standard library Psych.

psych is an package containing functions for analysing personality, psychometrics and experimental psychology. Functions are primarily for scale construction using factor analysis, and analysis, although others provide basic descriptive statistics. Item Response Theory is done using factor analysis of tetrachoric and polychoric s. Functions for simulating particular item and test structures are included. Several functions serve as a useful front end for structural equation modeling. Graphical displays of path diagrams, and structural equation models are created using basic graphics.

Repositories

Vignettes

Other resources

Related tags

294 questions
2
votes
0 answers

Specifying min eigen value in factor analysis call in R

This is a statistics question-- In STATA, you can specify the minimum eigen value so that the optimal number of factors are chosen. . forvalues i=1/11{ 2. unab vars: `vv`i'' 3. di _n(3)"################## vars: `vars'…
NewBee
  • 990
  • 1
  • 7
  • 26
2
votes
1 answer

Prevent LaTeX comments from printing

I'm including in an RMarkdown document factor analysis results from the psych package. The factor loading table is printed using fa2latex(), in the psychTools package. The R code looks like this: facm <- fa(corrmat, n.factors = 3, rotate =…
Stuart
  • 569
  • 6
  • 12
2
votes
1 answer

How to compute Cronbach's alpha for multiple subscales at the same time using R?

I am a beginner using R. I am struggling when I try to compute the Cronbach's alpha for multiple subscales. I was using the psych package to do it. Here is an example of my database: I have 2 different subscales. Subscale A includes items 1 to 3 and…
Rita
  • 59
  • 7
2
votes
1 answer

mixedCor: Misidentification of categorical data for PCA?

I am running a series of principal components analyses using the psych package in R. I have a mix of continuous (read discrete), binary, and ordinal variables. See below for a subset of the data comprising 10 continuous (read discrete) variables (c1…
C_H
  • 191
  • 14
2
votes
1 answer

Z-standardization makes PC1 and PC2 exactly the same in this PCA analysis: Why?

I am trying to perform a PCA analysis using the psych package in R. I got two variables that I want to combine into one component displaying standard of living: slvpen: Standard of living of pensioners: 0 = Extremely bad, 10 = Extremely…
SnupSnurre
  • 363
  • 2
  • 12
2
votes
2 answers

use psych reverse.code() on dataframe in R

I'm trying to use reverse.code() from the psych package on one column in a dataframe that has numeric and non-numeric columns. However, when I try to do this, I get an error: Error in items %*% keys.d : requires numeric/complex matrix/vector…
J.Sabree
  • 2,280
  • 19
  • 48
2
votes
1 answer

Why are polychoric correlation coefficients in matrices calculated by different R packages slightly different for the same data?

I calculated polychoric correlation matrices for the same data frame (20 ordinal variables, 190 missing values) in R, using three different packages and the coefficients for same variables are slightly different from each other. I used the lavCor…
Denise
  • 21
  • 2
2
votes
1 answer

Error in Psych::Mediate: Object Not Found

I'm running a mediation analysis on a dataset in r and can't figure out how to get psych::mediate to work--I've done the same on another dataset before and didn't change anything, but it's not working with this new data for some reason. I tried: 1.…
Axel
  • 23
  • 4
2
votes
1 answer

R psych tetrachoric - dichotomic variables

I have a dataframe of dichotomic variables corresponding to items of a personality questionnaire. Here are the first lines. head(mixclinic) # A tibble: 6 x 15 CMS_1 CMS_2 CMS_3 CMS_4 CMS_5 CMS_6 CMS_7 CMS_8 CMS_9 CMS_10 CMS_11
FcmC
  • 143
  • 9
2
votes
1 answer

Factor scores from factor analysis on ordinal categorical data in R

I'm having trouble computing factor scores from an exploratory factor analysis on ordered categorical data. I've managed to assess how many factors to draw, and to run the factor analysis using the psych package, but can't figure out how to get…
2
votes
1 answer

Error in changing the main title of an R plot using psych package

In the help page of the psych package, it says that I can pass more graphic parameters to the outlier() function. My syntax is really simple and as follows: outlier(na.omit(data[,51:56]), plot = TRUE, main = 'my title') This returns: Error in…
Anonymous
  • 502
  • 4
  • 23
2
votes
2 answers

How to exclude variables from the output of describeBy in the psych package?

I have the output of a describeBy, which is working fine, but as my dataset has quite a lot of variables I'm not interested in at this point, it's very difficult to manage, is there a way to exclude variables (or perform describeBy on particular…
Tom Parker
  • 23
  • 3
2
votes
1 answer

Install packages does not work: Permission denied

I'm struggling to install the package "psych". I started to use the command install.packages("psych"). The download started and the result was the following: Installing package into ‘C:/Users/Username/Documents/R/win-library/3.5’ (as ‘lib’ is…
Stan
  • 23
  • 1
  • 3
2
votes
2 answers

Why are there differences in psych::principal between "Varimax" and "varimax"?

In a related question, I have asked why there are differences between stats::varimax and GPArotation::Varimax, both of which psych::principal calls, depending on the option set for rotate =. The differences between these two (see other question)…
maxheld
  • 3,963
  • 2
  • 32
  • 51
2
votes
2 answers

Psych package: Which exploratory factor analysis method to apply

I am trying to conduct an exploratory factor analysis R using the psych package. My data consists of items from different scales- they are all very skewed, but differ in their number of response catgories (ranging from 4 to 7). Which factor analysis…
A. Bi.
  • 21
  • 2