factor-analysis

Factor Analysis using sparklyr in Databricks

丶灬走出姿态 提交于 2021-01-29 06:13:50
问题 I would like to perform a Factor Analysis by using dplyr::collect() in Databricks but because of its size I am getting this error: Error : org.apache.spark.sql.execution.OutOfMemorySparkException: Total memory usage during row decode exceeds spark.driver.maxResultSize (4.0 GB). The average row size was 82.0 B Is there a function in sparklyr using which I can do this analysis without collecting the data? 来源: https://stackoverflow.com/questions/64113459/factor-analysis-using-sparklyr-in

how to change gender factor into an numerical coding in r

有些话、适合烂在心里 提交于 2019-12-30 11:55:36
问题 I have a factor of males and females say c("male", "female","female") and I want to create a vector of c(0,1,1) How can i change that in r? 回答1: With boolean : a <- c("male", "female","female") (a=="female")*1 hth 回答2: Maybe not the most straight-forward way, but I would first change it to a factor, and then, if needed to an integer: a <- c("male", "female","female") a <- factor(a, levels=c("male","female"), labels=c(0,1)) a [1] 0 1 1 Levels: 0 1 as.integer(as.character(a)) #Need to be first

Subscript out of bound error in R

徘徊边缘 提交于 2019-12-24 04:49:06
问题 While Using factanal function from stats package for performing factor analysis. I tried following thing. library(mirt) library(ltm) library(psych) library(stats) data(SAT12) data=SAT12 cor_mat=polychoric(data, ML=TRUE, global=F) fit <- factanal(factors=2, n.obs=nrow(data), covmat=cor_mat$rho) Divide_item_Factor_Loading(fit) when I am trying to run Divide_item_Factor_Loading(fit) an error called Error in a[[i]][[2]] : subscript out of bounds pops up. my complete code of Divide_item_Factor

Reading Centroid extracted factor matrix into SPSS for rotation, analysis

拜拜、爱过 提交于 2019-12-08 05:44:26
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 3 years ago . UPDATE: 4/28 I found the proper syntax to import my centriod factor extraction into SPSS and rotate it. Because of limitations in SPSS on what subcommands can be used when reading a matrix in via MATRIX IN (...), I still need to find a way to get the FSCORE and save the new variable (/SAVE REG(ALL) ), but that is another post. What I believe to be the correct syntax is below,

Obtain unstandardized factor scores from factor analysis in R

﹥>﹥吖頭↗ 提交于 2019-12-06 16:19:51
I'm conducting a factor analysis of several variables in R using factanal() (but am open to using other packages). I want to determine each case's factor score, but I want the factor scores to be unstandardized and on the original metric of the input variables. When I run the factor analysis and obtain the factor scores, they are standardized with a normal distribution of mean=0, SD=1, and are not on the original metric of the input variables. How can I obtain unstandardized factor scores that have the same metric as the input variables? Ideally, this would mean a similar mean, sd, range, and

Reading Centroid extracted factor matrix into SPSS for rotation, analysis

眉间皱痕 提交于 2019-12-06 14:53:15
This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 3 years ago . UPDATE: 4/28 I found the proper syntax to import my centriod factor extraction into SPSS and rotate it. Because of limitations in SPSS on what subcommands can be used when reading a matrix in via MATRIX IN (...), I still need to find a way to get the FSCORE and save the new variable (/SAVE REG(ALL) ), but that is another post. What I believe to be the correct syntax is below, along with the proper setup of the matrix. Please correct me if I'm wrong! ORIGINAL POST: I've been

Obtaining unstandardized factor scores from factor analysis

会有一股神秘感。 提交于 2019-12-02 05:13:52
问题 I'm conducting a factor analysis of several variables in R using factanal(). I want to determine each case's factor score, but I want the factor scores to be unstandardized and on the original metric of the input variables. When I run the factor analysis and obtain the factor scores, they appear to be standardized and not on the original metric of the input variables. How can I obtain unstandardized factor scores that have the same metric as the input variables? Ideally, this would mean a

how to change gender factor into an numerical coding in r

断了今生、忘了曾经 提交于 2019-12-01 12:38:00
I have a factor of males and females say c("male", "female","female") and I want to create a vector of c(0,1,1) How can i change that in r? droopy With boolean : a <- c("male", "female","female") (a=="female")*1 hth Maybe not the most straight-forward way, but I would first change it to a factor, and then, if needed to an integer: a <- c("male", "female","female") a <- factor(a, levels=c("male","female"), labels=c(0,1)) a [1] 0 1 1 Levels: 0 1 as.integer(as.character(a)) #Need to be first transformed to a character [1] 0 1 1 #and then to an integer 来源: https://stackoverflow.com/questions

Obtain unstandardized factor scores from factor analysis in R

谁说胖子不能爱 提交于 2019-12-01 12:32:44
问题 I'm conducting a factor analysis of several variables in R using factanal() (but am open to using other packages). I want to determine each case's factor score, but I want the factor scores to be unstandardized and on the original metric of the input variables. When I run the factor analysis and obtain the factor scores, they are standardized with a normal distribution of mean=0, SD=1, and are not on the original metric of the input variables. How can I obtain unstandardized factor scores