Announcement

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

  • Predicted Factor scores after SEM from two populations-- how to compare

    Dear Statalist users,
    I have a Stata v15 and working with two separate datasets with about 1000 observations. The data come from surveys conducted in two different countries, and most questions are exactly the same with the same response options.
    My goal is to compare a latent construct that is measured using about 9 variables across the two countries. I use structural equation modelling to estimate the latent variables separately in each country, and my target variable is the second-order variable.

    I use the predict command to get a score and then transform to the variable to 0-1 scale and compare means of independent samples.
    However, in another post on factor scores after SEM Clyde Schechter commented that "the actual values of the factor scores are really not meaningful at all." I am hoping their mean values mean something and can be compared across different samples.

    My question is whether I should run separate sems for each country or append the observations from the second country and run a single sem model to predict one latent variable and run a t-test by country.
    Mathematically what would be the most accurate way to compare the means? My hypothesis is the mean of the second-order variable (GE) is significantly higher in country 1 than in country 2. When I rescale the predicted score to 0-1 scale, I do see support for my hypothesis but in the original scale where mean is set to 0 (Standardized), no difference is observed and I think it is precisely because the mean is set to be 0. So, is it ok to use the rescaled version of the predicted second-order variable to test for difference in means? Once again, I did run separate sems for each country to predict. Would you suggest instead run a single sem across the combined dataset?

    I am placing some data examples from each country with all the variables used in the SEM and my commands.
    Thanks for your help.

    DATA EXAMPLE (COUNTRY 1)
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(Pop Sm Pur Ath Clas RI AA AS RA)
    2 2 1 2 3 2 1 1 1
    3 1 2 3 3 1 1 1 4
    3 2 1 3 2 1 1 1 3
    3 2 1 3 3 3 4 2 4
    2 1 3 2 3 1 1 1 3
    3 2 2 3 2 3 3 1 2
    2 3 2 4 3 3 2 1 3
    3 3 2 3 2 2 3 2 4
    3 3 3 3 3 2 4 2 4
    3 1 1 2 3 2 1 1 4
    3 3 1 3 3 3 1 1 4
    4 2 3 4 4 3 2 2 4
    3 2 2 2 3 3 2 2 3
    1 1 1 4 4 1 1 1 4
    3 3 3 4 2 2 1 1 4
    1 1 1 2 1 3 1 1 4
    2 1 1 4 3 4 1 2 3
    3 4 2 4 3 3 3 2 4
    2 4 2 4 3 3 1 2 3
    2 3 1 3 3 4 1 1 4
    4 1 3 2 4 4 2 1 4
    4 3 3 4 3 3 2 1 4
    3 3 2 2 3 2 2 2 2
    3 2 3 3 3 3 2 2 3
    2 2 1 3 2 3 2 1 3
    3 3 3 4 4 3 3 3 4
    2 1 2 1 4 1 2 1 4
    3 3 2 3 4 1 4 2 1
    2 3 4 3 3 4 3 3 3
    3 1 2 3 4 2 2 2 3
    2 1 3 3 3 4 2 1 2
    3 4 4 4 4 4 3 2 2
    3 4 3 4 3 4 4 2 4
    3 4 2 2 3 3 3 4 1
    3 1 2 3 3 3 2 1 3
    3 2 1 4 3 4 1 1 4
    4 1 1 1 1 4 1 1 3
    3 3 2 2 2 3 2 1 4
    2 1 1 1 4 2 1 2 4
    3 2 4 3 3 4 1 2 3
    2 2 3 3 3 4 2 1 4
    3 4 1 4 4 3 1 2 4
    3 1 1 3 3 1 1 1 4
    4 3 3 3 4 2 2 2 3
    3 3 2 4 3 2 3 2 4
    3 1 1 2 3 2 2 1 3
    2 1 2 3 1 3 2 1 3
    3 1 1 3 3 3 1 1 4
    2 1 1 2 4 4 1 1 4
    2 2 4 4 2 4 3 1 3
    3 1 2 1 3 3 2 1 3
    4 3 4 1 3 1 1 1 3
    3 2 2 3 3 3 2 1 3
    3 2 2 3 3 3 2 1 3
    3 1 2 3 3 3 2 1 4
    2 2 2 4 3 2 1 1 4
    3 3 4 4 4 3 3 2 3
    3 1 2 3 3 4 1 3 4
    3 2 2 2 3 3 2 1 3
    3 3 2 3 3 3 2 2 3
    4 2 2 3 3 4 2 1 3
    2 1 1 3 3 1 2 1 3
    4 2 2 4 4 4 1 2 4
    3 2 2 4 3 3 2 2 3
    2 1 1 2 3 3 4 2 3
    3 2 2 3 3 3 2 1 3
    3 1 2 3 4 3 3 3 3
    2 1 2 3 3 3 1 1 4
    1 1 1 2 1 1 1 1 1
    3 1 1 3 3 4 2 1 4
    1 1 1 2 1 2 1 1 1
    2 2 2 2 3 2 2 1 4
    3 1 1 2 2 2 2 1 3
    4 1 1 3 4 4 4 1 4
    4 4 2 4 3 2 4 3 4
    2 3 2 4 1 3 1 1 4
    2 2 2 3 3 2 3 1 3
    3 2 1 3 4 4 2 3 2
    3 2 2 3 3 4 2 2 3
    1 1 1 3 3 2 2 1 1
    3 4 2 3 3 3 2 2 3
    3 1 1 3 3 2 2 2 3
    3 3 4 4 3 4 4 2 4
    3 1 1 3 3 1 2 2 3
    3 3 3 3 3 3 3 2 4
    2 2 2 2 4 3 2 2 3
    1 1 1 1 2 2 1 1 2
    3 2 2 3 3 2 2 1 3
    3 2 2 3 3 3 2 1 3
    2 2 2 2 3 2 2 2 4
    3 3 2 4 3 3 2 2 4
    1 1 1 1 1 2 2 2 2
    3 1 2 3 3 3 2 1 3
    3 3 2 3 4 4 2 1 4
    3 4 1 4 1 3 1 1 2
    3 1 1 3 4 3 1 1 3
    2 2 1 4 3 2 4 1 4
    2 2 3 4 4 2 3 2 4
    3 2 1 3 2 3 2 2 4
    3 4 1 4 4 3 2 3 3
    end
    DATA EXAMPLE (COUNTRY 2)
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float( Pop Sm Pur Ath Clas RI AA AS RA)
    2 1 1 1 2 2 1 1 3
    2 1 1 2 1 2 3 1 1
    3 1 4 2 4 1 4 1 4
    2 2 2 3 3 2 2 1 3
    3 1 2 3 3 4 1 1 3
    3 1 4 4 3 3 2 1 4
    3 2 4 3 3 3 4 1 4
    3 2 2 3 3 3 2 1 3
    2 3 4 4 2 4 2 1 4
    2 3 3 3 3 3 3 2 2
    3 1 . 3 4 3 4 2 3
    1 1 1 3 3 4 2 1 3
    2 2 3 2 2 2 1 1 3
    3 1 4 2 4 2 4 1 2
    4 3 1 3 2 1 1 1 4
    3 3 3 3 3 2 2 2 3
    3 2 4 3 3 3 4 1 3
    2 3 1 3 3 2 2 1 2
    1 1 1 1 1 3 2 1 2
    3 3 2 2 3 2 2 2 4
    3 1 2 3 3 3 1 1 3
    3 4 3 4 3 4 2 2 4
    3 3 2 3 3 4 2 3 4
    3 3 1 3 2 2 1 2 4
    3 2 3 4 1 4 1 1 4
    1 1 1 1 1 1 1 1 3
    3 1 3 3 3 4 2 1 3
    3 2 3 2 3 2 1 2 4
    1 1 2 3 2 3 2 2 3
    4 2 1 3 4 4 1 1 4
    3 1 1 1 1 2 1 1 4
    3 1 2 3 2 2 1 1 4
    1 1 1 3 1 1 1 1 3
    3 3 3 4 4 3 4 2 4
    1 1 1 2 3 3 2 1 1
    4 2 2 3 3 3 4 1 4
    3 1 1 4 3 1 2 1 3
    2 1 1 2 3 3 2 1 4
    3 2 1 3 3 4 4 2 2
    1 3 4 3 3 2 2 2 2
    3 2 3 2 3 4 2 1 4
    3 1 2 4 4 2 2 1 4
    3 1 2 1 3 2 1 2 3
    3 2 2 2 3 2 1 1 3
    3 1 2 4 3 2 2 1 1
    3 2 2 3 3 3 3 2 4
    3 2 4 3 3 4 4 2 3
    3 1 2 3 4 2 2 1 3
    3 1 3 3 3 3 2 1 3
    2 3 2 3 4 2 3 2 3
    3 1 2 3 3 3 2 1 3
    2 1 1 3 1 4 4 1 1
    3 2 2 4 1 4 4 4 4
    3 1 2 3 2 1 2 1 4
    3 1 2 3 3 3 3 1 2
    2 1 3 3 2 2 4 2 4
    1 1 2 3 3 3 2 1 3
    3 1 1 3 3 1 2 2 3
    3 2 2 3 4 2 2 1 3
    3 3 4 3 3 4 1 1 4
    3 4 4 2 3 4 4 4 4
    4 1 1 1 3 2 4 1 4
    4 4 2 4 4 4 4 2 4
    3 1 2 2 2 2 2 2 3
    1 3 2 4 3 4 4 1 1
    1 1 1 3 1 4 1 1 4
    2 2 4 2 2 4 3 1 4
    3 3 2 3 3 3 2 1 3
    3 1 1 1 3 3 3 1 1
    2 1 2 4 1 4 4 2 4
    3 3 3 3 3 3 4 3 3
    3 3 4 3 3 3 4 3 3
    3 2 2 3 3 3 3 2 4
    3 1 1 3 3 3 2 1 3
    3 1 2 3 3 3 2 1 3
    3 1 2 2 3 2 1 1 3
    1 3 2 3 1 1 1 1 1
    3 3 2 3 2 2 1 1 3
    1 1 1 3 1 1 1 1 3
    3 1 1 2 3 1 2 1 3
    3 1 2 1 3 2 4 1 3
    3 3 3 3 1 2 2 1 4
    1 1 1 1 3 1 1 1 4
    2 1 1 3 3 4 2 3 3
    3 3 4 4 3 4 4 2 4
    3 2 1 3 1 2 4 2 4
    3 2 3 1 1 2 4 2 2
    3 1 1 4 3 2 2 1 4
    3 1 3 3 3 3 2 1 3
    4 1 1 1 3 4 1 1 4
    3 1 2 2 2 4 1 1 1
    3 3 3 3 1 3 3 1 3
    3 3 3 4 1 4 2 1 4
    3 1 1 3 2 2 2 1 4
    3 2 3 3 3 4 2 1 3
    1 1 1 3 1 1 1 1 3
    3 1 1 1 2 3 1 1 3
    3 1 2 2 2 2 2 1 4
    4 1 3 3 4 4 2 1 4
    3 1 1 3 1 2 2 1 3
    end


    Code:
    sem (CoD-> Ath Sm Pur) ///
     (CaD -> Pop RA Clas) ///
     (PG -> AA AS RI) ///
     (GE -> CoD CaD PG) ///
    , difficult latent(CoD CaD PG GE) nocapslatent standardized 
    predict CoD CaD PG GE, latent

  • #2
    Originally posted by Sule Yaylaci View Post
    My hypothesis is the mean of the second-order variable (GE) is significantly higher in country 1 than in country 2.
    I can't remember whether Release 15 had all of sem's group options and I don't know whether a thousand observations will be sufficient with your difficult-to-converge model to assess all of the invariance assumptions, anyway. But I would at least try to go that route as a first choice.

    Absent that, maybe you can consider something like the following.

    .ÿ
    .ÿversionÿ15.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿquietlyÿinputÿfloat(PopÿSmÿPurÿAthÿClasÿRIÿAAÿASÿRA)

    .ÿ
    .ÿgenerateÿbyteÿcouÿ=ÿ0

    .ÿ
    .ÿtempfileÿfirst

    .ÿquietlyÿsaveÿ`first'

    .ÿ
    .ÿdropÿ_all

    .ÿ
    .ÿquietlyÿinputÿfloat(ÿPopÿSmÿPurÿAthÿClasÿRIÿAAÿASÿRA)

    .ÿ
    .ÿgenerateÿbyteÿcouÿ=ÿ1

    .ÿappendÿusingÿ`first'

    .ÿ
    .ÿrenameÿ_all,ÿlower

    .ÿ
    .ÿquietlyÿsemÿ(athÿsmÿpurÿ<-ÿCoD)

    .ÿtempnameÿB

    .ÿmatrixÿdefineÿ`B'ÿ=ÿe(b)

    .ÿlocalÿnamesÿ:ÿcolfullnamesÿe(b)

    .ÿlocalÿnamesÿ:ÿsubinstrÿlocalÿnamesÿ"var(CoD)"ÿ"var(e.CoD)"

    .ÿmatrixÿcolnamesÿ`B'ÿ=ÿ`names'

    .ÿ
    .ÿquietlyÿsemÿ(popÿraÿclasÿ<-ÿCaD)

    .ÿtempnameÿA

    .ÿmatrixÿdefineÿ`A'ÿ=ÿe(b)

    .ÿlocalÿnamesÿ:ÿcolfullnamesÿe(b)

    .ÿlocalÿnamesÿ:ÿsubinstrÿlocalÿnamesÿ"var(CaD)"ÿ"var(e.CaD)"

    .ÿmatrixÿcolnamesÿ`A'ÿ=ÿ`names'

    .ÿmatrixÿdefineÿ`B'ÿ=ÿ`B',ÿ`A'

    .ÿ
    .ÿquietlyÿsemÿ(aaÿasÿriÿ<-ÿPG)

    .ÿmatrixÿdefineÿ`A'ÿ=ÿe(b)

    .ÿlocalÿnamesÿ:ÿcolfullnamesÿe(b)

    .ÿlocalÿnamesÿ:ÿsubinstrÿlocalÿnamesÿ"var(PG)"ÿ"var(e.PG)"

    .ÿmatrixÿcolnamesÿ`A'ÿ=ÿ`names'

    .ÿmatrixÿdefineÿ`B'ÿ=ÿ`B',ÿ`A'

    .ÿ
    .ÿquietlyÿsemÿ///
    >ÿÿÿÿÿÿÿÿÿ(athÿsmÿpurÿ<-ÿCoD)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(popÿraÿclasÿ<-ÿCaD)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(aaÿasÿriÿ<-ÿPG)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(CoDÿCaDÿPGÿ<-ÿGE),ÿfrom(`B')ÿdifficultÿ///
    >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿtechnique(nrÿ5ÿbhhhÿ5ÿdfpÿ5ÿbfgsÿ5)

    .ÿassertÿe(converged)

    .ÿ
    .ÿmatrixÿdefineÿ`B'ÿ=ÿe(b)

    .ÿlocalÿnamesÿ:ÿcolfullnamesÿe(b)

    .ÿlocalÿnamesÿ:ÿsubinstrÿlocalÿnamesÿ"var(GE)"ÿ"var(e.GE)"

    .ÿmatrixÿcolnamesÿ`B'ÿ=ÿ`names'

    .ÿ
    .ÿsemÿ///
    >ÿÿÿÿÿÿÿÿÿ(athÿsmÿpurÿ<-ÿCoD)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(popÿraÿclasÿ<-ÿCaD)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(aaÿasÿriÿ<-ÿPG)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(CoDÿCaDÿPGÿ<-ÿGE)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(GEÿ<-ÿcou),ÿfrom(`B')ÿdifficultÿnocnsreportÿnodescribeÿnolog
    (1ÿobservationsÿwithÿmissingÿvaluesÿexcluded)

    StructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿ199
    Estimationÿmethod:ÿml

    Logÿlikelihoodÿ=ÿ-2335.8178

    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿOIM
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿstd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
    -------------+----------------------------------------------------------------
    Structuralÿÿÿ|
    ÿÿCoDÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿGEÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿCaDÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿGEÿ|ÿÿÿ.6710211ÿÿÿÿÿÿÿ.222ÿÿÿÿÿ3.02ÿÿÿ0.003ÿÿÿÿÿÿ.235909ÿÿÿÿ1.106133
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿPGÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿGEÿ|ÿÿÿ1.069047ÿÿÿ.3532255ÿÿÿÿÿ3.03ÿÿÿ0.002ÿÿÿÿÿ.3767373ÿÿÿÿ1.761356
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿGEÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿcouÿ|ÿÿ-.1047904ÿÿÿ.0759883ÿÿÿÿ-1.38ÿÿÿ0.168ÿÿÿÿ-.2537248ÿÿÿÿÿ.044144
    -------------+----------------------------------------------------------------
    Measurementÿÿ|
    ÿÿathÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿCoDÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.891328ÿÿÿ.0719315ÿÿÿÿ40.20ÿÿÿ0.000ÿÿÿÿÿ2.750345ÿÿÿÿ3.032311
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿsmÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿCoDÿ|ÿÿÿ1.649502ÿÿÿ.3055601ÿÿÿÿÿ5.40ÿÿÿ0.000ÿÿÿÿÿ1.050616ÿÿÿÿ2.248389
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ1.985489ÿÿÿ.0922353ÿÿÿÿ21.53ÿÿÿ0.000ÿÿÿÿÿ1.804711ÿÿÿÿ2.166267
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿpurÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿCoDÿ|ÿÿÿ1.101909ÿÿÿ.2409859ÿÿÿÿÿ4.57ÿÿÿ0.000ÿÿÿÿÿ.6295852ÿÿÿÿ1.574233
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿÿ2.08257ÿÿÿ.0786027ÿÿÿÿ26.49ÿÿÿ0.000ÿÿÿÿÿ1.928512ÿÿÿÿ2.236629
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿpopÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿCaDÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.708348ÿÿÿ.0604804ÿÿÿÿ44.78ÿÿÿ0.000ÿÿÿÿÿ2.589809ÿÿÿÿ2.826888
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿraÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿCaDÿ|ÿÿÿ.6159022ÿÿÿ.1672692ÿÿÿÿÿ3.68ÿÿÿ0.000ÿÿÿÿÿ.2880606ÿÿÿÿ.9437437
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ3.227575ÿÿÿ.0634052ÿÿÿÿ50.90ÿÿÿ0.000ÿÿÿÿÿ3.103304ÿÿÿÿ3.351847
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿclasÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿCaDÿ|ÿÿÿ.7294501ÿÿÿÿ.208741ÿÿÿÿÿ3.49ÿÿÿ0.000ÿÿÿÿÿ.3203252ÿÿÿÿ1.138575
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.784311ÿÿÿÿ.065505ÿÿÿÿ42.51ÿÿÿ0.000ÿÿÿÿÿ2.655924ÿÿÿÿ2.912699
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿaaÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿPGÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.196435ÿÿÿ.0806679ÿÿÿÿ27.23ÿÿÿ0.000ÿÿÿÿÿ2.038329ÿÿÿÿ2.354541
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿasÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿPGÿ|ÿÿÿ.8233315ÿÿÿ.1709106ÿÿÿÿÿ4.82ÿÿÿ0.000ÿÿÿÿÿÿ.488353ÿÿÿÿÿ1.15831
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ1.498147ÿÿÿ.0575822ÿÿÿÿ26.02ÿÿÿ0.000ÿÿÿÿÿ1.385288ÿÿÿÿ1.611006
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿriÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿPGÿ|ÿÿÿ.6795805ÿÿÿÿ.196175ÿÿÿÿÿ3.46ÿÿÿ0.001ÿÿÿÿÿ.2950847ÿÿÿÿ1.064076
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ2.761492ÿÿÿ.0733879ÿÿÿÿ37.63ÿÿÿ0.000ÿÿÿÿÿ2.617655ÿÿÿÿÿ2.90533
    -------------+----------------------------------------------------------------
    ÿÿÿvar(e.ath)|ÿÿÿ.5553361ÿÿÿ.0646666ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.4420149ÿÿÿÿ.6977098
    ÿÿÿÿvar(e.sm)|ÿÿÿ.4003309ÿÿÿÿÿ.09601ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.2501948ÿÿÿÿ.6405602
    ÿÿÿvar(e.pur)|ÿÿÿ.6749697ÿÿÿ.0820545ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.5318702ÿÿÿÿ.8565699
    ÿÿÿvar(e.pop)|ÿÿÿ.2795965ÿÿÿ.0876902ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.1512058ÿÿÿÿ.5170055
    ÿÿÿÿvar(e.ra)|ÿÿÿ.6242528ÿÿÿ.0708571ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.4997388ÿÿÿÿ.7797905
    ÿÿvar(e.clas)|ÿÿÿ.6045184ÿÿÿ.0778109ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.4697283ÿÿÿÿÿ.777987
    ÿÿÿÿvar(e.aa)|ÿÿÿ.7298022ÿÿÿ.0938429ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.5672205ÿÿÿÿ.9389845
    ÿÿÿÿvar(e.as)|ÿÿÿÿ.261954ÿÿÿ.0478717ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.1830919ÿÿÿÿ.3747838
    ÿÿÿÿvar(e.ri)|ÿÿÿÿ.796367ÿÿÿ.0887938ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.6400376ÿÿÿÿ.9908799
    ÿÿÿvar(e.CoD)|ÿÿÿ.0249911ÿÿÿ.0482273ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0005691ÿÿÿÿ1.097522
    ÿÿÿvar(e.CaD)|ÿÿÿ.2467538ÿÿÿ.0932812ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.1176199ÿÿÿÿ.5176625
    ÿÿÿÿvar(e.PG)|ÿÿÿ.0838858ÿÿÿ.0702803ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0162384ÿÿÿÿ.4333447
    ÿÿÿÿvar(e.GE)|ÿÿÿ.1649385ÿÿÿÿ.069122ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0725442ÿÿÿÿ.3750085
    ------------------------------------------------------------------------------
    LRÿtestÿofÿmodelÿvs.ÿsaturated:ÿchi2(32)ÿ=ÿ80.22ÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.0000

    .ÿtestÿ[GE]couÿ//ÿ<-ÿHere

    ÿ(ÿ1)ÿÿ[GE]couÿ=ÿ0

    ÿÿÿÿÿÿÿÿÿÿÿchi2(ÿÿ1)ÿ=ÿÿÿÿ1.90
    ÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.1679

    .ÿestimatesÿstoreÿUnconstrained

    .ÿ
    .ÿconstraintÿdefineÿ1ÿ_b[GE:cou]ÿ=ÿ0

    .ÿquietlyÿsemÿ///
    >ÿÿÿÿÿÿÿÿÿ(athÿsmÿpurÿ<-ÿCoD)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(popÿraÿclasÿ<-ÿCaD)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(aaÿasÿriÿ<-ÿPG)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(CoDÿCaDÿPGÿ<-ÿGE)ÿ///
    >ÿÿÿÿÿÿÿÿÿ(GEÿ<-ÿcou),ÿfrom(`B')ÿdifficultÿconstraints(1)

    .ÿassertÿe(converged)

    .ÿlrtestÿUnconstrainedÿ//ÿ<-ÿAndÿhere

    Likelihood-ratioÿtest
    Assumption:ÿ.ÿnestedÿwithinÿUnconstrained

    ÿLRÿchi2(1)ÿ=ÿÿÿ2.04
    Probÿ>ÿchi2ÿ=ÿ0.1536

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Comment


    • #3
      Thanks so much, Joseph~

      Comment


      • #4
        If I were to get Stata 18, how would the command look? I am guessing I will be able to run sem with the option group (country).

        Comment


        • #5
          Originally posted by Sule Yaylaci View Post
          If I were to get Stata 18, . . . I am guessing I will be able to run sem with the option group (country).
          Yes, you guessed correctly.

          Comment

          Working...
          X