[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: data management for the weight option of -gllamm-

From   Alessio Fusco <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: data management for the weight option of -gllamm-
Date   Fri, 31 Oct 2008 15:21:27 +0100

Dear Stata users,

I want to estimate a MIMIC model with –gllamm- but I am facing difficulty of data management to use the weight option when I include the covariates of the structural equation.

The measurement model I estimate is a two parameter logistic IRT model.
I have 5 dichotomous items and for item i and subject j, we have


Where betai is the difficulty parameter of the item, lambdai  the discriminate parameter and nj is the person ability.

To start with I would like to add a simple structural equation:
nj = v0 + v1 male + v2 CL2 + v0 CL3 + e
where male is a dummy (1 if men and 0 if women)
I categorized the variable age in dummys:
[CL1] = <30
[CL2] = 30-49
[CL3] = 50+

// create the pattern
egen pattern = group(item1 item2 item3 item4 item5 male CL2 CL3)
// compute wt2
contract item1 item2 item3 item4 item5 male CL2 CL3 pattern, f(wt2)
// stack variables into a single vector

reshape long item, i(pattern) j(art)

//create the dummies
tab art, gen(d)

// MIMIC model - difficulty parameter of item 1 set at 0
gen cons=1
eq load: d1-d5
eq f1: cons male CL2 CL3

gllamm item d2-d5, i(pattern) eqs(load) l(logit) f(binom) weight(wt) /*
  */ geqs(f1) from(a) nocons adapt nip(12)

This works but I am not sure if I should also include CL1 in the command
egen pattern = group(item1 item2 item3 item4 item5 male CL1 CL2 CL3)
Also, what shall I do if I want to add a continuous covariate…

The use of –gllamm- is not so easy so that any help would be greatly appreciated as I am not sure I handle the things properly.

Alessio Fusco

CEPS/INSTEAD – GD. Luxembourg

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index