TITLE: BSEM on big-five BHPS data - females
DATA: FILE = BHPS OINDRESPX1.DAT;
VARIABLE: NAMES =
! b5a1r b5a2 b5a3 b5c1 b5c2r b5c3 b5e1 b5e2 b5e3r b5n1 b5n2 b5n3r
! b5o1 b5o2 b5o3
y1-y15
fsb5n fsb5a fsb5e fsb5c fsb5o
ohid opno oXRWTUK2
osex dGH RGHSQ RGHCUB DAG RASQ RACUB
ragsx rasqsx racubsx
rGHsx rGHSqsx rGHcubsx
ragGH rasqGH racubGH
ragGHS rasqGHS racubGHS
ragGHC rasqGHC racubGHC
agec10 bfagec10 missb5,xhhid,indid xindid;
usevariables y1-y15;
! 7-point scale from 1 does not apply to 7 applies perfectly
! weight is oXRWTUK2;
missing are all (-9.99);
! cluster is ohid;
!, asex;
! grouping is asex (1=g1 2=g2);
! age = dag+47.068+0.306 = dag+47.4, so
! dag = age - 47.4
! osex = 1 for males and 2 for females
useobs = osex eq 2 and (dag gt 2 and dag lt 8); ! females age 50-55
define:
standardize y1-y15;
ANALYSIS:
estimator = bayes;
process = 2;
chain = 1; !to not have too much info carried into graphics when requesting STDY
fbiter = 100000;
thin=10;
MODEL:
fa by y1-y3;
fc by y4-y6;
fe by y7-y9;
fn by y10-y12;
fo by y13-y15;
fa-fo (fv1-fv5);
fa-fo with fa-fo (ac ae an ao ce cn co en eo no);
y1 on y2@0; ! to get stdy
! x-loadings:
fa by y4-y15*0 (a1-a12);
fc by y1-y3*0 (c1-c3)
y7-y15*0 (c4-c12);
fe by y1-y6*0 (e1-e6)
y10-y15*0 (e7-e12);
fn by y1-y9*0 (n1-n9)
y13-y15*0 (n10-n12);
fo by y1-y12*0 (o1-o12);
y1-y15 (p1-p15);
y1-y15 with y1-y15 (p16-p120); !upper-triangular elements taken row-wise
model priors:
a1-a12~N(0,0.01);
c1-c12~N(0,0.01);
e1-e12~N(0,0.01);
n1-n12~N(0,0.01);
o1-o12~N(0,0.01);
p1-p15~IW(1,21);
p16-p120~IW(0,21);
model constraint:
New(rac rae ran rao rce rcn rco ren reo rno);
rac = ac/(sqrt(fv1)*sqrt(fv2));
rae = ae/(sqrt(fv1)*sqrt(fv3));
ran = an/(sqrt(fv1)*sqrt(fv4));
rao = ao/(sqrt(fv1)*sqrt(fv5));
rce = ce/(sqrt(fv2)*sqrt(fv3));
rcn = cn/(sqrt(fv2)*sqrt(fv4));
rco = co/(sqrt(fv2)*sqrt(fv5));
ren = en/(sqrt(fv3)*sqrt(fv4));
reo = eo/(sqrt(fv3)*sqrt(fv5));
rno = no/(sqrt(fv4)*sqrt(fv5));
OUTPUT:
tech1 tech8 stdy;
Plot:
type = plot2;