Download presentation

Presentation is loading. Please wait.

Published byBrisa Pleas Modified about 1 year ago

1
Using MX for SEM analysis

2
Using Lisrel Analysis of Reader Reliability in Essay Scoring Votaw's Data Tau-Equivalent Model DA NI=4 NO=126 LA ORIGPRT1 WRITCOPY CARBCOPY ORIGPRT2 CM 25.0704 12.4363 28.2021 11.7257 9.2281 22.7390 20.7510 11.9732 12.0692 21.8707 MO NX=4 NK=1 LX=FR PH=ST LK Esayabil EQ LX(1) - LX(4) PD OU

3
The models in Mx A path diagram consists of four basic types of object: circles, squares, one-headed and two-headed arrows. These correspond to the following basic concepts of statistical multivariate modeling: Two types of variables: observed (in squares), non-observed (in circles) Two types of relationship between variables are possible: causal (one headed arrow) and correlational (two-headed arrow). The RAM specification (McArdle and Boker, 1990) involves three matrices: F, A and S. S is for the symmetric paths (two-headed, correlational), F is the filtering the set of observed variables out of the whole set. A is for the asymmetric paths (one-headed arrows, causal). z = F v v = A v + e ---> v = (I – A ) -1 e The covariance matrix of z, Cov (z), is structured as: Cov (z) = F (I – A ) -1 S ((I – A ) -T F’ Instead of Cov we could just have the moment matrices, E zz’ and E vv’. Moment Structure: = ( (here = cov (y), or Eyy’) We fit the sample moment matrix M to = (

4
Matrix calculator #NGroups 1 Title aa Calculation Begin Matrices; A Full 2 2 B Full 1 2 End Matrices; Matrix A 1.5.5 1 Matrix B 1 2 Begin Algebra; C= A~; D = A+A; i=\det(A); End Algebra; End Group; Open Mx Just as a matrix computator xxx.mx file

5
Computing means and cov from raw data file Title Compute Means and Covariances Calculation NG=1 Begin Matrices; X full 15 5 Z zi 5 4 ! Selection matrix End Matrices; Matrix X #include string.rec Begin Algebra; Y = X*Z; M = \mean(Y); C = \cov(Y); End Algebra; Option mxc=string.cov Option mxm=string.mea End Using the raw data string.rec (In the same folder That we save this compute.mx) File compute.mx saved in the same folder as String.rec Output will be in compute.mxo string.cov string.mea String data:

6
! Anything after a ! is a comment ! ! Mx script to fit a simple model ! One factor in A plus specifics in D ! Use #define to simplify setting matrix dimensions ! #define nvar 3 #define nfac 1 Simple MX example file Ngroups=1 Data NObservations=150 NInput_vars=nvar CMatrix 3.23 2.26 2.65 2.57 2.84 3.23 Begin Matrices; A Full nvar nfac Free D Diag nvar nvar Free End Matrices; Start.5 All ! All free parameters to start at.5 Bound 0 100 D 1 1 to D nvar nvar ! Keep specific variances positive Covariance A*A' + D ; Option RS ! to get residuals End Open Mx Open a new file Paste (or write) the Commands Save the file with The extension.mx Run it The file Factor1.mx String data:

7
! Anything after a ! is a comment ! ! Mx script to fit a simple model ! One factor in A plus specifics in D ! Use #define to simplify setting matrix dimensions ! #define nvar 4 #define anvar 3 #define nfac 1 Simple MX example file Ngroups=1 Data NObservations=15 NInput_vars=nvar CMatrix Full File=string.cov Label True Brian David Graham ! Select True Brian David Graham ; Select Brian David Graham; Begin Matrices; A Full anvar nfac Free D Diag anvar anvar Free End Matrices; Start.5 All ! All free parameters to start at.5 Bound 0 100 D 1 1 to D anvar anvar ! Keep specific variances positive Covariance A*A' + D ; Option RS ! to get residuals End Open Mx Open a new file Paste (or write) the Commands Save the file with The extension.mx Run it The file Factor1.mx String data:

8
Using row data !MxGui auto-generated data group data file Data Ninput=5 NObservation=15 REctangle File=string.rec Label Id True Brian David Graham This is the file string.dat 1 6.3 5 4.8 6 2 4.1 3.2 3.1 3.5 3 5.1 3.6 3.8 4.5 4 5 4.5 4.1 4.3 5 5.7 4 5.2 5 6 3.3 2.5 2.8 2.6 7 1.3 1.7 1.4 1.6 8 5.8 4.8 4.2 5.5 9 2.8 2.4 2 2.1 10 6.7 5.2 5.3 6 11 1.5 1.2 1.1 1.2 12 2.1 1.8 1.6 1.8 13 4.6 3.4 4.1 3.9 14 7.6 6 6.3 6.5 15 2.5 2.2 1.6 2 This is the file String.rec (with spaces )

9
Using the graphic interface path diagram > datamap > search for the data file in raw > select variables We do factor analysis model

10
Fitting a one factor model Using the graphic options: Open the path dyagram interface Open de file factor.dat Select the variables on the file factor.dat Finish drawing the model Run and observe... ! ! Factor.dat - example factor analysis data ! Data Ninput=5 Nobs=100 Labels verb perf matrix digit speed CMatrix 1.2.1 1.4.2.3 1.5.5.4.3 2.0.3.2.4.5 2.1 This is file factor.dat

12
More on using Mx

13
An ascii xxx.dat file Data Nimput=6 Nobservations=85 CMatrix 4.389 3.792 4.410 1.935 1.855 2.385 1.454 1.453 0.989 1.914 1.087 1.309 0.841 0.961 1.480 1.623 1.701 1.175 1.279 1.220 1.971 Labels In1 In2 Beh A1 A2 A3 File: coupon.dat

14
1: Path diagram > new diagram 2: data map 3: open file 4: opne it 5: it brings the variables in

15
6: highlight the variables 7: press on new

16
Run the program

17
Chi2 Goodness of fit df

18
Label de Latent variables (clic twice...)

19
parameter estimates …

20
CI Change on chi2

21
Script file File open

22
Script file See the output file

23
New diagram window Open new file New datamap

26
Setting paramters to be equal across groups Overall chi2

28
Lattin and Roberts data of adoption new technologies p. 366 of Lattin et al. See the data file adoption.txt in RMMRS

29
Using row data !MxGui auto-generated data group data file Data Ninput=5 NObservation=15 REctangle File=string.rec Label Id True Brian David Graham This is the file string.dat 1 6.3 5 4.8 6 2 4.1 3.2 3.1 3.5 3 5.1 3.6 3.8 4.5 4 5 4.5 4.1 4.3 5 5.7 4 5.2 5 6 3.3 2.5 2.8 2.6 7 1.3 1.7 1.4 1.6 8 5.8 4.8 4.2 5.5 9 2.8 2.4 2 2.1 10 6.7 5.2 5.3 6 11 1.5 1.2 1.1 1.2 12 2.1 1.8 1.6 1.8 13 4.6 3.4 4.1 3.9 14 7.6 6 6.3 6.5 15 2.5 2.2 1.6 2 This is the file String.rec (with spaces )

30
1 2 3 4 5. highlight 6

31
This is for modeling means

32
Analysis of Adoption data

33
data=read.table("E:/Albert/COURSES/RMMSS/Mx/ADOPTION.txt", header=T) names(data) [1] "ADOPt1" "ADOPt2" "VALUE1" "VALUE2" "VALUE3" "USAGE1" "USAGE2" "USAGE3" attach(data) round(cov(data, use="complete.obs"),2) ADOPt1 ADOPt2 VALUE1 VALUE2 VALUE3 USAGE1 USAGE2 USAGE3 ADOPt1 675.17 489.24 6.25 5.46 4.08 10.62 11.69 7.12 ADOPt2 489.24 994.31 4.16 4.46 3.42 16.35 17.92 12.17 VALUE1 6.25 4.16 0.95 0.37 0.45 0.16 0.19 0.12 VALUE2 5.46 4.46 0.37 0.83 0.31 0.11 0.12 0.07 VALUE3 4.08 3.42 0.45 0.31 0.86 0.13 0.18 0.05 USAGE1 10.62 16.35 0.16 0.11 0.13 0.76 0.64 0.45 USAGE2 11.69 17.92 0.19 0.12 0.18 0.64 0.92 0.55 USAGE3 7.12 12.17 0.12 0.07 0.05 0.45 0.55 0.64 Warning message: NAs introduced by coercion dim(data) [1] 188 8

34
Data Nimput=8 Nobservations=188 CMatrix 675.17 489.24 994.31 6.25 4.16 0.95 5.46 4.46 0.37 0.83 4.08 3.42 0.45 0.31 0.86 10.62 16.35 0.16 0.11 0.13 0.76 11.69 17.92 0.19 0.12 0.18 0.64 0.92 7.12 12.17 0.12 0.07 0.05 0.45 0.55 0.64 Labels ADOPt1 ADOPt2 VALUE1 VALUE2 VALUE3 USAGE1 USAGE2 USAGE3 Adoption.dat

35
One factor model for Value

36
Two factor model

37
Model complert (utilitza la matriu de correlacions)

38
Loadings of Adoption constrained. Loadings of Adoption constrained

39
Exercices Lattin et al. pp. 383-385: 10.1 to 10.7, and specially 10.7

40
10.7 of p. 384 (Lettin et al. ) Impact of students’ attitude toward math and their evaluation. Students in the program were surveyed Twice about their attitude (once at the beginning of the fall semester and again at the beginning of the srping semester). The researcher has also access to the score of a graduate-level student attitude test from the program application. The researcher used the following three questions to assess attitude toward math (each measured on a seven point semantic differntial scale). X1 Nervous-Confident X2 Capable-Inept X3 Angry-Happy XX1 to XX3, the same on time 2 The researcher captured the student’s evaluation of the quantitative course with the following Three measures (all measured on a sevent point Likert scale from 7 = strongly agree to 1 = strongly disagree ) Y1 I will be able to use what I learned Y2 The subject matter of this course was not relevant to me Y3 This was a great course Tscore Apptitude Test Score (from the program application) Research Question: Test the hypothesis that there is no effect of attitude toward math on student evaluations of the new quantitative course, controlling for the effect of student aptitude. What do you conclude ?.

41
data= read.table("E:/Albert/COURSES/RMMSS/MATH_ATTITUDElabels.txt", header=T) > attach(data) > names(data) [1] "ID" "X1" "X2" "X3" "XX1" "XX2" "XX3" "Y1" [9] "Y2" "Y3" "Tscore" pairs(data[,2:10]) dim(data) [1] 141 11 > round(cor(data[,2:11]),2) X1 X2 X3 XX1 XX2 XX3 Y1 Y2 Y3 Tscore X1 1.00 -0.65 0.61 0.86 -0.62 0.54 0.33 -0.20 0.28 0.15 X2 -0.65 1.00 -0.56 -0.60 0.84 -0.49 -0.22 0.16 -0.18 -0.14 X3 0.61 -0.56 1.00 0.59 -0.54 0.86 0.25 -0.17 0.28 0.04 XX1 0.86 -0.60 0.59 1.00 -0.78 0.73 0.24 -0.17 0.26 0.08 XX2 -0.62 0.84 -0.54 -0.78 1.00 -0.70 -0.18 0.15 -0.20 -0.12 XX3 0.54 -0.49 0.86 0.73 -0.70 1.00 0.18 -0.14 0.25 0.03 Y1 0.33 -0.22 0.25 0.24 -0.18 0.18 1.00 -0.58 0.62 0.29 Y2 -0.20 0.16 -0.17 -0.17 0.15 -0.14 -0.58 1.00 -0.50 -0.15 Y3 0.28 -0.18 0.28 0.26 -0.20 0.25 0.62 -0.50 1.00 0.19 Tscore 0.15 -0.14 0.04 0.08 -0.12 0.03 0.29 -0.15 0.19 1.00 > round(cov(data[,2:11]),2) X1 X2 X3 XX1 XX2 XX3 Y1 Y2 Y3 Tscore X1 2.62 -1.67 1.60 2.47 -1.77 1.59 0.85 -0.47 0.66 12.53 X2 -1.67 2.51 -1.43 -1.69 2.36 -1.42 -0.57 0.37 -0.42 -11.62 X3 1.60 -1.43 2.64 1.69 -1.56 2.55 0.65 -0.40 0.66 3.72 XX1 2.47 -1.69 1.69 3.16 -2.48 2.37 0.67 -0.43 0.67 7.71 XX2 -1.77 2.36 -1.56 -2.48 3.16 -2.30 -0.50 0.38 -0.52 -11.77 XX3 1.59 -1.42 2.55 2.37 -2.30 3.36 0.52 -0.38 0.68 2.89 Y1 0.85 -0.57 0.65 0.67 -0.50 0.52 2.56 -1.36 1.44 24.25 Y2 -0.47 0.37 -0.40 -0.43 0.38 -0.38 -1.36 2.10 -1.04 -11.59 Y3 0.66 -0.42 0.66 0.67 -0.52 0.68 1.44 -1.04 2.09 14.44 Tscore 12.53 -11.62 3.72 7.71 -11.77 2.89 24.25 -11.59 14.44 2808.07 >>

42
An ascii xxx.dat file Data Nimput=10 Nobservations=141 CMatrix FULL 2.62 -1.67 1.60 2.47 -1.77 1.59 0.85 -0.47 0.66 12.53 -1.67 2.51 -1.43 -1.69 2.36 -1.42 -0.57 0.37 -0.42 -11.62 1.60 -1.43 2.64 1.69 -1.56 2.55 0.65 -0.40 0.66 3.72 2.47 -1.69 1.69 3.16 -2.48 2.37 0.67 -0.43 0.67 7.71 -1.77 2.36 -1.56 -2.48 3.16 -2.30 -0.50 0.38 -0.52 -11.77 1.59 -1.42 2.55 2.37 -2.30 3.36 0.52 -0.38 0.68 2.89 0.85 -0.57 0.65 0.67 -0.50 0.52 2.56 -1.36 1.44 24.25 -0.47 0.37 -0.40 -0.43 0.38 -0.38 -1.36 2.10 -1.04 -11.59 0.66 -0.42 0.66 0.67 -0.52 0.68 1.44 -1.04 2.09 14.44 12.53 -11.62 3.72 7.71 -11.77 2.89 24.25 -11.59 14.44 2808.07 Labels X1 X2 X3 XX1 XX2 XX3 Y1 Y2 Y3 Tscore File: math.dat X1 Nervous-Confident X2 Capable-Inept X3 Angry-Happy XX1 to XX3, the same on time 2 On the scale 7 = strongly agree to 1 = strongly disagree Y1 I will be able to use what I learned Y2 The subject matter of this course was not relevant to me Y3 This was a great course Tscore Apptitude Test Score

43
One factor model

44
The costumer Orientatin of Service Workers: Personality Trait Effects on Self and Supervisor Performance Ratings Tom J. Brown et al. May 2000 (forthcoming, Journal of Marketing Research)

45
The items

46
Sample moments

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google