Three level ordinal analysis
Posted: Thu Apr 11, 2013 11:43 am
Hi,
I am using runmlwin to run a three-level longitudinal model (area>individual>repeated observation) with a ordinal outcome (1-4). I am able to run the three level model when the outcome variable (Qint) is continuous or a two level model with the ordinal outcome but NOT the three level model. Suggestions?
Outcome: Qint
Level 3: samsstr (area)
Level 2: id (individual)
Level 1: occasion
I run
reshape long Qint, i(id) j(occasion) (should I include the area?)
It works when the outcome is continuous
runmlwin Qint cons, level3(samsstr: cons) level2(id: cons) level1(occasion: cons) nopause (This works well, Qint continuous)
It works when the outcome is ordinal but two levels:
sort id occasion occasion
runmlwin Qintcat4r cons, level2(id: (cons, contrast(1/3))) level1(occasion:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(4)) nopause
But when I want to do the three levels, it give an error:
sort samsstr id occasion occasion
runmlwin Qintcat4r cons, level3(samsstr: cons) level2(id: (cons, contrast(1/3))) level1(occasion:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(4))
The error says: IDEN 2 ´occasion´. Unexpanded level 2 ide column(occasion) must not contain consecutive repeated codes, in multivariate or multinomial models. Use the GENErate command to create unique id codes.
Thanks in advance,
Miguel
I am using runmlwin to run a three-level longitudinal model (area>individual>repeated observation) with a ordinal outcome (1-4). I am able to run the three level model when the outcome variable (Qint) is continuous or a two level model with the ordinal outcome but NOT the three level model. Suggestions?
Outcome: Qint
Level 3: samsstr (area)
Level 2: id (individual)
Level 1: occasion
I run
reshape long Qint, i(id) j(occasion) (should I include the area?)
It works when the outcome is continuous
runmlwin Qint cons, level3(samsstr: cons) level2(id: cons) level1(occasion: cons) nopause (This works well, Qint continuous)
It works when the outcome is ordinal but two levels:
sort id occasion occasion
runmlwin Qintcat4r cons, level2(id: (cons, contrast(1/3))) level1(occasion:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(4)) nopause
But when I want to do the three levels, it give an error:
sort samsstr id occasion occasion
runmlwin Qintcat4r cons, level3(samsstr: cons) level2(id: (cons, contrast(1/3))) level1(occasion:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(4))
The error says: IDEN 2 ´occasion´. Unexpanded level 2 ide column(occasion) must not contain consecutive repeated codes, in multivariate or multinomial models. Use the GENErate command to create unique id codes.
Thanks in advance,
Miguel