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 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 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 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 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 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 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 This is file factor.dat

11

12
More on using Mx

13
An ascii xxx.dat file Data Nimput=6 Nobservations=85 CMatrix 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

24

25

26
Setting paramters to be equal across groups Overall chi2

27

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 This is the file String.rec (with spaces )

30
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 ADOPt ADOPt VALUE VALUE VALUE USAGE USAGE USAGE Warning message: NAs introduced by coercion dim(data) [1] 188 8

34
Data Nimput=8 Nobservations=188 CMatrix 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 : 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] > round(cor(data[,2:11]),2) X1 X2 X3 XX1 XX2 XX3 Y1 Y2 Y3 Tscore X X X XX XX XX Y Y Y Tscore > round(cov(data[,2:11]),2) X1 X2 X3 XX1 XX2 XX3 Y1 Y2 Y3 Tscore X X X XX XX XX Y Y Y Tscore >>

42
An ascii xxx.dat file Data Nimput=10 Nobservations=141 CMatrix FULL 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

47

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google