Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reading and writing raw data files: See previous slides and file examples for instructions re covariance matrices Writing from SPSS: recode v1 to v16 (missing,sysmiss=999).

Similar presentations


Presentation on theme: "Reading and writing raw data files: See previous slides and file examples for instructions re covariance matrices Writing from SPSS: recode v1 to v16 (missing,sysmiss=999)."— Presentation transcript:

1 Reading and writing raw data files: See previous slides and file examples for instructions re covariance matrices Writing from SPSS: recode v1 to v16 (missing,sysmiss=999). missing values v1 to v16 (-999). write outfile = ‘c:\temp\myfile2.dat’ / v1 v2 v4 v8 to v16 (15F5.0). execute. 1 3 new slides: see handout

2 SAS: libname sas2 ‘c:\temp’;  location of SAS file filename out2 ‘c:\temp\rawdata1.dat’; data; set sas2.mydata; array a1 v1 -- v16; do over a1; if a1=. then a1=999; end; file out2 ls=150; put (v1 v2 v4 v5--v16)(15*10.3); run; 2

3 STATA outfile v1 v2 v4 v5-v16 using c:\temp\rawdata1.dat, nolabel wide 3

4 Reading raw data into MPlus Data: File is c:\temp\rawdata1.dat; Listwise = ON;  if required; otherwise uses FIML estimation for missing data VARIABLE: Names are v1 v2 v4 v5 v6 v7 v8 v9 V10 v11 v12 v13 v14 v15 v16; Missing are ALL (999); Grouping is (1=male 2=female); <- if multiple group problem 4

5 Two-Tailed Estimate S.E. Est./S.E. P-Value Group G1 ALC ON AGE EDUC PERINC WORK Group 2 ALC ON AGE EDUC PERINC WORK Estimate S.E. Est./S.E. P-Value Intercepts ALC MENTHLTH Males: Alc = *Perinc Females: Alc = *Perinc Perinc score ranges from 1 through 6 New slide: also on file Day3(Wrapup)

6

7 Much trickier if more than 1 X-variable has non-parallel slope Males: Alc = *Perinc Females: Alc = *Perinc Problem: this estimated difference would now only apply when the other X-variable(s) has a score of 0 E.g., only applicable when education = 0 Usually, we’ll want to hold other variables constant at their means. One solution: mean-centre the variables (not an issue with latent variables, where means are 0 by default in group 1; only an issue with single-indicator manifest X- variables). Or, do some additional calculations: Males: Alc = 0 + [ed coefficient [males]* mean of educ] +.191*perinc Females: Alc = [ed coffficient[females]* mean of educ] +.058*perinc

8 8 Factor of curves

9 alternative, “curve of factors” 9 zero intercept one indicator per factor see Duncan & al, Introduction to Latent Variable Growth Curve Modeling, 1999, chapter 5 for a brief discussion **This is a new slide

10 factor of curves vs. curve of factors factor of curves more parsimonious difficult to choose from the 2 curve of factors probably more common ( for example, it is this approach that we see in Bollen and Curran, Latent Curve Models: A Structural Equation Perspective, p. 246ff.) 10 Exercise #6 used the “curve of factors” approach, which is more common **This is a new slide

11 From yesterday’s exercise #6 Model: Disab1 BY Disab2 BY ; Disab3 BY ; Disab1 BY sense1 (1); Disab2 BY sense2 (1); Disab3 BY sense3 (1); Disab1 BY task1 (2); Disab2 BY task2 (2); Disab3 BY task3 (2); [task1] (3); [sense1] (4); [task2] (3); [sense2] (4); [task3] (3); [sense3] (4); ; sense1 WITH sense2; sense2 WITH sense3; sense1 WITH sense3; Int BY Slope BY [Int]; [Slope]; 11 Fix mean of 3 latent variables (one LV for each time point) to mean of move indicator) But, with LV means (technically intercepts) set to zero, values passed on to the int variable. Int variable will have mean approx = mean of move1

12 Means INT SLOPE Intercepts MOVE TASK SENSE MOVE TASK SENSE MOVE TASK SENSE DISAB DISAB DISAB

13 An alternative parameterization Disab1 BY Disab2 BY ; Disab3 BY ; Disab1 BY sense1 (1); Disab2 BY sense2 (1); Disab3 BY sense3 (1); Disab1 BY task1 (2); Disab2 BY task2 (2); Disab3 BY task3 (2); [move1] (5); [move2] (5); [move3] (5); [task1] (3); [sense1] (4); [task2] (3); [sense2] (4); [task3] (3); [sense3] (4); ; sense1 WITH sense2; sense2 WITH sense3; sense1 WITH sense3; Int BY Slope BY [Slope]; task2 WITH task1; 13 Not = 0 but equality constraints across time, just like other 2 indicators Must fix to zero

14 This model includes correlated errors for the sense indicator INT ON ED BLACK YEARBORN WORKING RETIRED SLOPE ON ED BLACK YEARBORN WORKING RETIRED

15 Also a gender effect: (we didn’t include gender in Ex. #6) I NT ON ED BLACK YEARBORN WORKING RETIRED SEX SLOPE ON ED BLACK YEARBORN WORKING RETIRED SEX Sex 1=male 0=female

16 A more complex model, sometimes with slopes predicting slopes Be careful of causal order issues though 16 INT ON YEARBORN ED SEX SLOPE ON YEARBORN ED SEX Int = intercept for disability Slope = slope for disability

17 A more complex model, sometimes with slopes predicting slopes Predicting earnings INT: EARNINT ON INT YEARBORN ED SEX Int = intercept for disability Slope = slope for disability z

18 Predicting earnings slope: EARNSLOP ON INT SLOPE EARNSLOP ON YEARBORN ED SEX Int = intercept for disability Slope = slope for disability

19 Predicting alcohol consumption slope! ALCSLOP ON INT SLOPE EARNINT EARNSLOP YEARBORN ED SEX Int = intercept for disability Slope = slope for disability

20 piecewise latent curve model 20 not shown: 0 path (not needed!) from slope2 to v1-t1, v1-t2 parm33R M Slope1: change from time 1 through time 3 Slope 2: Change from time 3 through time 5 New slide not previously discussed


Download ppt "Reading and writing raw data files: See previous slides and file examples for instructions re covariance matrices Writing from SPSS: recode v1 to v16 (missing,sysmiss=999)."

Similar presentations


Ads by Google