BookmarkSubscribeRSS Feed
lisa_merrill_gmail_com
Calcite | Level 5

Hi,

I am trying to run a hierarchical factor model with items contributing to measures that contribute to elements. The data is from a survey, and I would like not only to test the fit of the model but also to calculate scores of the measure factors and element factor.  Below is my code.  The CFA runs just fine but I am running into trouble with the scoring.  Obviously, I need the data from the factors created by the measure to make the element but those do not exist on my original data file.  I'm stuck, does anyone have any ideas?

proc corr data=GENS22015 out= cfaLTCH;

var T201a  T201b T201c T201d T201e T208a T208b T208c T208d T1002

T1001 T209c T1011 T209e T1010 T209g T209h T210a T210c T210e T1004 T1004b;

run;

/*Below: f1-f4 are measures, and f5 is an element*/

proc calis data=cfaLTCH nobs = 63513 method= max pestim se corr   outstat=ostat;

title 'comfirmatory factor model for leadership';

  lineqs

  T201a = x1*f1 + e1,

  T201b = x2*f1+ e2,

  T201c = x3*f1 + e3,

  T201d = x4*f1 + e4,

  T201e = x5*f1 + e5,

  T208a = x6*f2 + e6,

  T208b = x7*f2 + e7,

  T208c = x8*f2 + e8,

  T208d = x9*f2 + e9,

  T1002 = x10*f3 + e10,

  T1001 = x11*f3 + e11,

  T209c = x12*f3 + e12,

  T1011 = x13*f3 + e13,

  T209e = x14*f3 + e14,

  T1010 = x15*f3 + e15,

  T209g = x16*f3 + e16,

  T209h = x17*f3 + e17,

  T210a = x18*f4 + e18,

  /*T210c = x19*f4 + e19,*/

  /*T210e = x20*f4 + e20,*/

  T1004 = x19*f4 + e19,

  T1004b = x20*f4 + e20,

  f1 = x21*f5 + e21,

  f2  = x22*f5 + e22,

  f3 = x23*f5 + e23,

  f4 = x24*f5 + e24;

  variance

  f5 = 1.,

  e1-e20 = u1-u20,

  e21-e24 = 4*1.;

  bounds 0.<=u1-u20;

run;

proc score data=GENS22015 score = ostat out= scores;

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 0 replies
  • 594 views
  • 0 likes
  • 1 in conversation