!
! Interaction with multiple group approach
!
! Data from MacKenzie and Spreng (1992) How does motivation moderate
! the impact of central and peripheral processing on brand attitudes and
! intentions.  Journal of Computer Research 18:519-529
!
! See also Rigdon, E et al (1998) A comparative review of interaction and
! nonlinear modeling In: R. Schumacker and G. Marcoulides (eds) Interaction
! and nonlinear effects in structural equation modeling.  New York: Erlbaum
!

! define number of factors and number of observed variables

#define nvar 6
#define nfac 2

Title interaction for Ad & Brand attitude: Low Group
 Data NInput=nvar Nobs=200 NGroups=2
 CMatrix Full File=low.cov
 Means File=low.mean
 Matrices
  A Full  nfac 1         ! Factor Means              
  D Diag  nfac nfac Free ! Factor Variances          
  B Sdiag nfac nfac Free ! Factor -> Factor paths    
  I Iden  nfac nfac	                            
  L Full nvar nfac      ! Factor -> Observed paths  
  E Diag nvar nvar Free ! Residual Vars on Observed 
  M Full nvar 1 Free ! Score Means               
 End Matrices

 Start 1 L 1 1 L 4 2 
 Free L 2 1 L 3 1 L 5 2 L 6 2

 Mean L*(I-B)~*A + M ;
 Covariance L*(I-B)~*D*(I-B)~'*L'+ E ;

 Option RS
End Group


Title interaction for Ad & Brand attitude: High Group
 Data NInput=nvar Nobs=160 NGroups=2
 CMatrix Full File=high.cov
 Means File=high.mean
 Matrices = Group 1
  A Full  nfac 1    Free  ! Factor Means (different from group 1)
  B Sdiag nfac nfac Free  ! Factor -> Factor paths (different from group 1)
 End Matrices 

 Start 1 All 

 Mean L*(I-B)~*A + M ;
 Covariance L*(I-B)~*D*(I-B)~'*L'+ E ;
 
 Option Rsid 
 Option Multiple
End Group

! write current results to binary file
 Save general.mxs

! Fit model with same slopes
  Equate B 1 2 1 B 2 2 1
  End

! Fit model with same means
 Get general.mxs
  Drop 20 21
  !Equate A 2 1 1 A 1 1 1
  !Equate A 2 2 1 A 1 2 1
  End

! Fit model with same means and same slopes
  Equate B 1 2 1 B 2 2 1
End







