Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing observations - exploratory factor analysis efa

    I am running an exploratory factor analysis (EFA) using an individual-level survey data set. The survey answers are coded from 1-5 (agree, agree strongly..) where "does not apply" is coded as missing value. When I run the EFA using Stata's "factor" command, Stata only shows me the output for the observations with non-missing variables. But I would still like to use the responses of an individual even if they clicked "does not apply" for one or more questions or if they only completed part of the survey. How can I do that? I'm losing valuable information here...

  • #2
    Originally posted by Cecily Josten View Post
    I would still like to use the responses of an individual even if they clicked "does not apply" for one or more questions or if they only completed part of the survey. How can I do that?
    Something like the following might do in a pinch. It uses -factormat- with pairwise correlations from -pwcorr-. Begin at the "Begin here" comment.

    .ÿ
    .ÿversionÿ17.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿ//ÿseedem
    .ÿsetÿseedÿ81044616

    .ÿ
    .ÿtempnameÿCorr

    .ÿmatrixÿdefineÿ`Corr'ÿ=ÿJ(5,ÿ5,ÿ0.7)ÿ+ÿI(5)ÿ*ÿ0.3

    .ÿquietlyÿdrawnormÿl1ÿl2ÿl3ÿl4ÿl5,ÿdoubleÿcorr(`Corr')ÿn(200)

    .ÿ
    .ÿforvaluesÿiÿ=ÿ1/5ÿ{
    ÿÿ2.ÿÿÿÿÿÿÿÿÿegenÿbyteÿo`i'ÿ=ÿcut(l`i'),ÿgroup(4)
    ÿÿ3.ÿÿÿÿÿÿÿÿÿquietlyÿreplaceÿo`i'ÿ=ÿo`i'ÿ+ÿ1
    ÿÿ4.ÿÿÿÿÿÿÿÿÿquietlyÿreplaceÿo`i'ÿ=ÿ.ÿifÿruniform()ÿ>ÿ0.9
    ÿÿ5.ÿ}

    .ÿ
    .ÿ*
    .ÿ*ÿBeginÿhere
    .ÿ*
    .ÿpwcorrÿo?

    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿo1ÿÿÿÿÿÿÿo2ÿÿÿÿÿÿÿo3ÿÿÿÿÿÿÿo4ÿÿÿÿÿÿÿo5
    -------------+---------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿo1ÿ|ÿÿÿ1.0000ÿ
    ÿÿÿÿÿÿÿÿÿÿo2ÿ|ÿÿÿ0.7185ÿÿÿ1.0000ÿ
    ÿÿÿÿÿÿÿÿÿÿo3ÿ|ÿÿÿ0.6719ÿÿÿ0.6553ÿÿÿ1.0000ÿ
    ÿÿÿÿÿÿÿÿÿÿo4ÿ|ÿÿÿ0.7084ÿÿÿ0.7108ÿÿÿ0.7118ÿÿÿ1.0000ÿ
    ÿÿÿÿÿÿÿÿÿÿo5ÿ|ÿÿÿ0.7137ÿÿÿ0.6665ÿÿÿ0.6755ÿÿÿ0.7570ÿÿÿ1.0000ÿ

    .ÿtempnameÿC

    .ÿmatrixÿdefineÿ`C'ÿ=ÿr(C)

    .ÿ
    .ÿquietlyÿcount

    .ÿlocalÿNÿ`r(N)'

    .ÿ
    .ÿfactormatÿ`C',ÿfactors(1)ÿn(`N')ÿforcepsd
    (obs=200)

    Factorÿanalysis/correlationÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿ=ÿÿÿÿÿÿÿÿ200
    ÿÿÿÿMethod:ÿprincipalÿfactorsÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRetainedÿfactorsÿ=ÿÿÿÿÿÿÿÿÿÿ1
    ÿÿÿÿRotation:ÿ(unrotated)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿparamsÿ=ÿÿÿÿÿÿÿÿÿÿ5

    ÿÿÿÿ--------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿFactorÿÿ|ÿÿÿEigenvalueÿÿÿDifferenceÿÿÿÿÿÿÿÿProportionÿÿÿCumulative
    ÿÿÿÿ-------------+------------------------------------------------------------
    ÿÿÿÿÿÿÿÿFactor1ÿÿ|ÿÿÿÿÿÿ3.43724ÿÿÿÿÿÿ3.44631ÿÿÿÿÿÿÿÿÿÿÿÿ1.0758ÿÿÿÿÿÿÿ1.0758
    ÿÿÿÿÿÿÿÿFactor2ÿÿ|ÿÿÿÿÿ-0.00908ÿÿÿÿÿÿ0.04113ÿÿÿÿÿÿÿÿÿÿÿ-0.0028ÿÿÿÿÿÿÿ1.0730
    ÿÿÿÿÿÿÿÿFactor3ÿÿ|ÿÿÿÿÿ-0.05021ÿÿÿÿÿÿ0.01969ÿÿÿÿÿÿÿÿÿÿÿ-0.0157ÿÿÿÿÿÿÿ1.0573
    ÿÿÿÿÿÿÿÿFactor4ÿÿ|ÿÿÿÿÿ-0.06990ÿÿÿÿÿÿ0.04321ÿÿÿÿÿÿÿÿÿÿÿ-0.0219ÿÿÿÿÿÿÿ1.0354
    ÿÿÿÿÿÿÿÿFactor5ÿÿ|ÿÿÿÿÿ-0.11311ÿÿÿÿÿÿÿÿÿÿÿÿ.ÿÿÿÿÿÿÿÿÿÿÿ-0.0354ÿÿÿÿÿÿÿ1.0000
    ÿÿÿÿ--------------------------------------------------------------------------
    ÿÿÿÿLRÿtest:ÿindependentÿvs.ÿsaturated:ÿÿchi2(10)ÿ=ÿÿ697.31ÿProb>chi2ÿ=ÿ0.0000

    Factorÿloadingsÿ(patternÿmatrix)ÿandÿuniqueÿvariances

    ÿÿÿÿ---------------------------------------
    ÿÿÿÿÿÿÿÿVariableÿ|ÿÿFactor1ÿ|ÿÿÿUniquenessÿ
    ÿÿÿÿ-------------+----------+--------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿo1ÿ|ÿÿÿ0.8340ÿ|ÿÿÿÿÿÿ0.3045ÿÿ
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿo2ÿ|ÿÿÿ0.8127ÿ|ÿÿÿÿÿÿ0.3395ÿÿ
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿo3ÿ|ÿÿÿ0.7981ÿ|ÿÿÿÿÿÿ0.3630ÿÿ
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿo4ÿ|ÿÿÿ0.8627ÿ|ÿÿÿÿÿÿ0.2558ÿÿ
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿo5ÿ|ÿÿÿ0.8367ÿ|ÿÿÿÿÿÿ0.3000ÿÿ
    ÿÿÿÿ---------------------------------------

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .


    I'm losing valuable information here...
    You might want to compare the factor structures that you get with listwise omission and pairwise correlation coefficients. It's not necessarily a given that respondents who refuse to respond or who click "NA" on various subsets of items will share the same correlation pattern with those who complete the entire form.

    Comment

    Working...
    X