About xxM › Forums › NL-SEM and xxM › *Please Help* Days Nested Within Students
Tagged: Please Help
- This topic has 2 replies, 2 voices, and was last updated 8 years, 6 months ago by Anonymous.
-
AuthorPosts
-
-
July 21, 2016 at 1:04 am #2084AnonymousInactive
Hi there,
I am having difficulty getting xxm to recognize the nested structure of my data with days nested within students. As I go to run my multilevel CFA it keeps saying “ID value 1 is duplicated. It appears at locations 0 and 12” and then it won’t let me run the model. When I give each day a unique identifier the model runs…but the days aren’t unique, they are 12 repeated assessments nested within individuals…the day ID is supposed to be repeated.
My level 1 dataset is structured as follows: Any help would be greatly appreciated!! Thanks, Tyler
day student y1 y2
1 1 2 4
2 1 4 4
3 1 3 4
4 1 4 4
5 1 7 4
6 1 6 2
7 1 4 4
8 1 4 4
9 1 2 4
10 1 4 4
11 1 0 4
12 1 8 4
1 2 4 7
2 2 4 3
3 2 4 3
4 2 5 4
5 2 2 4
6 2 2 3
7 2 4 3
… … — …- This topic was modified 8 years, 6 months ago by .
- This topic was modified 8 years, 6 months ago by .
-
July 25, 2016 at 9:46 am #2087Paras MehtaKeymaster
Your data and model correspond to the example on the help page:
http://xxm.times.uh.edu/learn-xxm/latent-growth-curve-model/Please take a look at the data for the example. Here is the key change you would need to make:
The first column must be IDs for the specific level (‘response’). In your case, the first column is a predictor. Create a new column called ‘response’. Each row of ‘response’ will be a unique integer value. ‘response’ will also be the the name of the first level. Doing so allows xxM to link data from the ‘response’ level to student level data.hope this helps.
-
July 26, 2016 at 12:09 pm #2088AnonymousInactive
Thank you Dr. Mehta, your suggestion worked!
Although the model is now running, I am still struggling to figure out how to define my lambda matrices (within-level and cross-level). I have three latent factors at both level 1 and level 2. Each of these latent factors are connected to 18 observed indicators, with 6 indicators presumed to load on factor 1, 6 on factor 2, and 6 on factor 3. I am trying to test a CFA to confirm this factor structure.
When I specify the lambda matrices I do so as follows:
##Level 1 lambda loadings
Lev1_pat <- matrix(c(0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1),18,3)
Lev1_pat
Lev1_val <- matrix(c(1,.4,.9,.8,.4,.6, 1,.8,.5,.8,.4,.6, 1,.3,.7,.5,.9,.9),18,3)
Lev1_val##Cross level lambda loadings
ly12_pat <- matrix(c(0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1),18,3)
ly12_pat
ly12_val <- matrix(c(1,.4,.9,.8,.4,.6, 1,.8,.5,.8,.4,.6, 1,.3,.7,.5,.9,.9),18,3)
ly12_valIn each case, the resultant output estimates 48 lambdas when I only want 18 estimates (6 estimates per latent variable). Any advice you have about how I might go about altering my matrix specification would be much appreciated. All of my other matrices appear to be fine (nu, alpha, theta, psi) …once I get the lambdas sorted out, I think it will be ready to go!
Thank you so much for all of your help!
-
-
AuthorPosts
- You must be logged in to reply to this topic.