I am trying to run a mediation model using SAS Studio on Demand for Academic with three treatments repeatedly measured at four different time points.
The IV and DV are latent variables-so each contains four scaled items.
I also have a few control variables.
So, for example:
I have an IV (5 items) and DV (4 items).
I repeatedly measured both IV and DV under three different treatments or conditions four different times.
So, it would look like this:
IVCondition1/DVlCondition1 time0, IVCondition1/Condition1 time1, IVCondition1/DVCondition1 time2, IVCondition1/DVCondition1 time3
IVCondition2/DVlCondition2 time0, IVCondition2/Condition2 time1, IVCondition2/DVCondition2 time2, IVCondition2/DVCondition2 time3
IVCondition1/DVlCondition3 time0, IVCondition1/Condition3 time1, IVCondition1/DVCondition3 time2, IVCondition3/DVCondition3 time3
I also have control variables which I measure once.
proc calis data=work.import1 method=ml; /* Define latent variables for IV and DV */
Define: IV Latent_IV1 Latent_IV2 Latent_IV3; /* IV with three indicators */ DV Latent_DV1 Latent_DV2 Latent_DV3 Latent_DV4; /* DV with four indicators */ /* Specify measurement model for IV and DV */ model: /* Measurement model for IV */ IV =~ Latent_IV1 Latent_IV2 Latent_IV3; /* Measurement model for DV */ DV =~ Latent_DV1 Latent_DV2 Latent_DV3 Latent_DV4; /* Specify treatment effects at different time points for IV */ path: IV_T0 <-- IV_T1 <-- IV_T2 <-- IV_T3; /* Specify treatment effects at different time points for DV */ path: DV_T0 <-- DV_T1 <-- DV_T2 <-- DV_T3; /* Control variables */ FRLegitimacy1-FRLegitimacy6 UAEnational Incomelevel Educationlevel YearsUAEres; /* Structural equation model specification */ lineqs: /* Include the effect of IV at Time 0 on DV at Time 0 */ DV_T0 = b1*IV_T0; /* Include the effect of IV at Time 1 on DV at Time 1 */ DV_T1 = b2*IV_T1; /* Include the effect of IV at Time 2 on DV at Time 2 */ DV_T2 = b3*IV_T2; /* Include the effect of IV at Time 3 on DV at Time 3 */ DV_T3 = b4*IV_T3; run;
Any help would be greatly appreciated. I also tried calling SAS's customer service to speak with an expert but they were unfortunately useless as they don't offer such help for the studio version.
I don't use Proc Calis much so not a prelude to answers.
Can you please go back to your SAS editor, clean up the formatting of the code if possible, then copy the text of the code and paste it into a text box opened on the forum with the </> icon that appears above the message window.
What you show is horrendous to attempt to read.
Do you have a specific questions? I don't see one. If you are asking about errors, then run the code and copy the code plus all of the messages from the log for the procedure and paste the result into a code box.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.