latent class analysis using stata · latent class analysis using stata chuck huber statacorp...
TRANSCRIPT
![Page 1: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/1.jpg)
Latent Class AnalysisUsing Stata
Chuck HuberStataCorp
University College LondonOctober 16, 2019
![Page 2: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/2.jpg)
Outline
• Latent class analysis (LCA)
– Estimation and postestimation options
– margins and marginsplot
• Latent class analysis with covariates
• Latent class analysis by groups
• Latent profile analysis
![Page 3: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/3.jpg)
Latent Class Analysis
• A latent class model is characterized by having a categorical latent variable and categorical observed variables.
• The levels of the categorical latent variable represent groups in the population and are called classes.
• We are interested in identifying and understanding these unobserved classes.
Class 1
Class 2
Class 3
![Page 4: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/4.jpg)
Latent Class Analysis
• Behavioral Research– Classify people who are more likely to exhibit specific
behaviors
– Different kinds of social phobias
– Categories of eating disorders
• Medicine and Health– Identify patients with different disease risk profiles
• Marketing Research – Differentiate subsets of customers and their buying habits
• And many, many more…
![Page 5: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/5.jpg)
Latent and Observed Variables
• Latent variables are hypothetical constructs that we cannot measure directly (e.g. “intelligence” or “depression”)
• Observed variables are variables that we observe (e.g. “SAT scores” or “Feel sad”)
![Page 6: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/6.jpg)
Latent and Observed Variables
Continuous Latent Categorical Latent
Continuous Observed
Factor analysis Latent Profile Analysis
Categorical Observed
Latent trait analysis orItem Response Theory
Latent Class Analysis
Reproduced from Table 1.1 in Collins and Lanza (2010)
![Page 7: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/7.jpg)
Example Data
![Page 8: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/8.jpg)
Example Data
• Class 1– “Possible rule breaking and norm violations”
– May include underage drinking
• Class 2– “More actively delinquent”
– Occasional drug use, skipping school, and non-violent crime
• Class 3– “Highly delinquent”
– Regular drug use, theft, and violent crime
![Page 9: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/9.jpg)
Example Data
Note that we do not have a variable for class membership.
![Page 10: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/10.jpg)
Example Data
![Page 11: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/11.jpg)
Class 1
Class 2
Class 3
vandalismalcohol truant theft weapon
Conceptual Path Diagram
![Page 12: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/12.jpg)
Statistics > LCA (latent class analysis)
gsem (alcohol truant vandalism theft weapon <- _cons) ///
, family(bernoulli) link(logit) lclass(C 3)
![Page 13: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/13.jpg)
The coefficients for class
![Page 14: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/14.jpg)
LCA Postestimation
![Page 15: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/15.jpg)
![Page 16: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/16.jpg)
![Page 17: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/17.jpg)
![Page 18: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/18.jpg)
LCA Postestimation
![Page 19: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/19.jpg)
Estimation and Postestimation
• First you estimate the parameters (fit the model)
gsem (alcohol truant vandalism theft weapon <- _cons) ///
, family(bernoulli) link(logit) lclass(C 3)
• Then you calculate quantities such as goodness-of-fit statistics, model predictions, residuals, etc
estat lcmean
estat lcprob
![Page 20: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/20.jpg)
margins and marginsplot
• You can use margins to calculate marginal predictions after you fit almost any kind of model in Stata.
• You can use marginsplot to graph those marginal predictions.
![Page 21: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/21.jpg)
margins and marginsplotmargins, predict(classpr class(1)) ///
predict(classpr class(2)) ///
predict(classpr class(3))
marginsplot, xtitle("") ytitle("") ///
xlabel(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
title("Predicted Latent Class Probabilities with 95% CI")
![Page 22: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/22.jpg)
margins and marginsplotmargins, predict(classpr class(1)) ///
predict(classpr class(2)) ///
predict(classpr class(3))
marginsplot, recast(bar) xtitle("") ytitle("") ///
xlabel(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
title("Predicted Latent Class Probabilities with 95% CI")
![Page 23: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/23.jpg)
margins and marginsplotmargins, predict(outcome(alcohol) class(3)) ///
predict(outcome(truant) class(3)) ///
predict(outcome(vandalism) class(3)) ///
predict(outcome(theft) class(3)) ///
predict(outcome(weapon) class(3))
marginsplot, recast(bar) xtitle("") ytitle("") ///
xlabel(1 "Alcohol" 2 "Truant" 3 "Vandalism" 4 "Theft" 5 "Weapon") ///
title("Predicted Probability of Behaviors For Class 3 with 95% CI")
![Page 24: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/24.jpg)
margins and marginsplotmargins, predict(outcome(alcohol) class(1)) ///
predict(outcome(alcohol) class(2)) ///
predict(outcome(alcohol) class(3))
marginsplot, recast(bar) xtitle("") ytitle("") ///
xlabel(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
title("Predicted Pr(alcohol=1) with 95% CI")
![Page 25: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/25.jpg)
LCA Postestimation
![Page 26: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/26.jpg)
LCA Postestimation
![Page 27: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/27.jpg)
How many classes?
quietly gsem (alcohol truant vandalism theft weapon <- ), logit lclass(C 1)
estimates store oneclass
quietly gsem (alcohol truant vandalism theft weapon <- ), logit lclass(C 2)
estimates store twoclass
quietly gsem (alcohol truant vandalism theft weapon <- ), logit lclass(C 3)
estimates store threeclass
![Page 28: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/28.jpg)
Options for Starting Values
![Page 29: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/29.jpg)
Options for Starting Values
gsem (alcohol truant vandalism theft weapon <- _cons) ///
, logit lclass(C 3) ///
startvalues(randompr, draws(20) seed(15))
![Page 30: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/30.jpg)
Options for Starting Values
gsem (alcohol truant vandalism theft weapon <- _cons) ///
, logit lclass(C 3) ///
startvalues(randompr, draws(20) seed(15) difficult)
![Page 31: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/31.jpg)
Options for the EM Algorithm
gsem (alcohol truant vandalism theft weapon <- _cons) ///
, logit lclass(C 3) ///
startvalues(randompr, draws(20) seed(15) difficult) ///
emopts(iterate(30) difficult)
![Page 32: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/32.jpg)
Outline
• Latent class analysis (LCA)
– Estimation and postestimation options
– margins and marginsplot
• Latent class analysis with covariates
• Latent class analysis by groups
• Latent profile analysis
![Page 33: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/33.jpg)
LCA With Covariates
![Page 34: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/34.jpg)
LCA With Covariates
gsem (alcohol truant vandalism theft weapon <- _cons) ///
(C <- age), family(bernoulli) link(logit) ///
lclass(C 3)
![Page 35: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/35.jpg)
LCA With Covariates
![Page 36: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/36.jpg)
LCA With Covariates
![Page 37: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/37.jpg)
LCA With Covariates
![Page 38: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/38.jpg)
margins, predict(classpr class(1)) ///
predict(classpr class(2)) ///
predict(classpr class(3)) ///
at(age=(13(1)18))
marginsplot, title("Predicted Latent Class Probabilities with 95% CI") ///
legend(order(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
rows(1) position(12) ring(1)) ytitle("")
margins and marginsplot
![Page 39: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/39.jpg)
Initial Values with the from()Option
gsem (alcohol truant vandalism theft weapon <- _cons) ///
(C <- age), family(bernoulli) link(logit) ///
lclass(C 3) from(b, skip)
![Page 40: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/40.jpg)
Initial Values with the from()Option
// Fit a model without age
gsem (alcohol truant vandalism theft weapon <- _cons) ///
, family(bernoulli) link(logit) ///
lclass(C 3)
// Store the parameter estimates in a matrix named b
matrix b = e(b)
// Fit a model including age using matrix b for the starting values
gsem (alcohol truant vandalism theft weapon <- _cons) ///
(C <- age), family(bernoulli) link(logit) ///
lclass(C 3) ///
from(b, skip)
![Page 41: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/41.jpg)
Outline
• Latent class analysis (LCA)
– Estimation and postestimation options
– margins and marginsplot
• Latent class analysis with covariates
• Latent class analysis by groups
• Latent profile analysis
![Page 42: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/42.jpg)
LCA By Groups
![Page 43: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/43.jpg)
LCA By Groups
gsem (alcohol truant vandalism theft weapon <- _cons) ///
(C <- age), family(bernoulli) link(logit) ///
lclass(C 3) group(male) ginvariant(coef)
![Page 44: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/44.jpg)
LCA By Groups
![Page 45: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/45.jpg)
LCA By Groups
![Page 46: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/46.jpg)
![Page 47: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/47.jpg)
Outline
• Latent class analysis (LCA)
– Estimation and postestimation options
– margins and marginsplot
• Latent class analysis with covariates
• Latent class analysis by groups
• Latent profile analysis
![Page 48: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/48.jpg)
Latent and Observed Variables
Continuous Latent Categorical Latent
Continuous Observed
Factor analysis Latent Profile Analysis
Categorical Observed
Latent trait analysis orItem Response Theory
Latent Class Analysis
Reproduced from Table 1.1 in Collins and Lanza (2010)
![Page 49: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/49.jpg)
Latent Profile Analysis
![Page 50: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/50.jpg)
Latent Profile Analysis
![Page 51: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/51.jpg)
Latent Profile Analysis
![Page 52: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/52.jpg)
Latent Profile Analysis
gsem (glucose insulin sspg <- _cons), ///
family(gaussian) link(identity) ///
lclass(C 3)
![Page 53: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/53.jpg)
Latent Profile Analysis
![Page 54: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/54.jpg)
Latent Profile Analysis
![Page 55: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/55.jpg)
Latent Profile Analysismargins, predict(classpr class(1)) ///
predict(classpr class(2)) ///
predict(classpr class(3))
marginsplot, xtitle("") ytitle("") ///
xlabel(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
title("Predicted Latent Class Probabilities with 95% CI")
![Page 56: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/56.jpg)
Latent Profile Analysismargins, predict(classpr class(1)) ///
predict(classpr class(2)) ///
predict(classpr class(3))
marginsplot, recast(bar) xtitle("") ytitle("") ///
xlabel(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
title("Predicted Latent Class Probabilities with 95% CI")
![Page 57: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/57.jpg)
Latent Profile Analysismargins, predict(outcome(glucose) class(1)) ///
predict(outcome(glucose) class(2)) ///
predict(outcome(glucose) class(3))
marginsplot, recast(bar) xtitle("") ytitle("") ///
xlabel(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
title("Predicted Mean Glucose For Each Class 95% CI")
![Page 58: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/58.jpg)
Latent Profile Analysismargins, predict(outcome(insulin) class(1)) ///
predict(outcome(insulin) class(2)) ///
predict(outcome(insulin) class(3))
marginsplot, recast(bar) xtitle("") ytitle("") ///
xlabel(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
title("Predicted Mean Insulin For Each Class 95% CI")
![Page 59: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/59.jpg)
Latent Profile Analysismargins, predict(outcome(sspg) class(1)) ///
predict(outcome(sspg) class(2)) ///
predict(outcome(sspg) class(3))
marginsplot, recast(bar) xtitle("") ytitle("") ///
xlabel(1 "Class 1" 2 "Class 2" 3 "Class 3") ///
title("Predicted Mean SSPG For Each Class 95% CI")
![Page 60: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/60.jpg)
Summary
• Latent class analysis (LCA)
– Estimation and postestimation options
– margins and marginsplot
• Latent class analysis with covariates
• Latent class analysis by groups
• Latent profile analysis
![Page 61: Latent Class Analysis Using Stata · Latent Class Analysis Using Stata Chuck Huber StataCorp chuber@stata.com University College London ... Factor analysis Latent Profile Analysis](https://reader030.vdocuments.site/reader030/viewer/2022040406/5e9e52b28ddb422f260778eb/html5/thumbnails/61.jpg)
Thanks for Coming!
Questions?
You can download the slides, dataset, and do-file here:https://tinyurl.com/2019LCA
You can contact me at:[email protected]