I am currently writing my BA, and I am trying to replicate the methodology of a paper that uses Stata for their analyis. The authors have provided me with the code they ran in Stata. However, I tried to translate it to R and dont seem to get the same results:
Stata: pca bmas_onl_c6_* rich_can_all parents_rich [aw=round(phrf)], fac(2)
pca bmas_onl_b8_* poor_risk_all poor_risk_certain poor_circum [aw=round(phrf)], fac(2)
Most importantly, (1) they concentrate on two factors, (2) use analytical weights and (3) run an oblique rotation.
For my analysis, I tried the (psych), the (GPArotation) and the (FactoMiner) packages, and usually received results that where somewhat diverging from the results the authors got. Other then that, I have the same amount of observations, and use the exact same data and variables.
If anyone could help me with getting the same results in R, I would be more than thankful!
I tried:
weights <- round(PCA_rich$phrf)
pca_result <- prcomp(pca_vars, scale. = TRUE)
pca_two_components <- pca_result$x[, 1:2]`
fa_result <- fa(pca_two_components, nfactors = 2, rotate = “oblimin”, fm = “pa”)
studisimon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.