Hi all, I am currently working on a large survey data which contains sample weights. The data is on individual student level and each student has achievement data for five time points. Now I need to run a longitudinal analysis on the data. So I firstly reshape the data into a long format. My adviser used a log-transferred time variable as one of the independent variables he put in the following syntax:
xtmixed READ LNAGE5 EASIA_CHILD_BH SEASIA_CHILD_BH SASIA_CHILD_BH USASIA_CHILD_BH BLACK HISP OTHER EASIAxLNAGE5 SEASIAxLNAGE5 SASIAxLNAGE5 /// USASIAxLNAGE5 BLACKxLNAGE5 HISPxLNAGE5 OTHERxLNAGE5 || SCHID:, || CHILDID: LNAGE5, mle cov(un) var pweight(C1_7FC0)
READ is the outcome variable, and LNAGE5 is the log-transferred variable of time (age of students when they took the test). I am not quite sure why he needs to do so but I did try running the syntax using the original time variable but stata gives me error messages. Anyone knows why? The rest of the independent variables are student race, and the interaction between student race and time points. My second question is once I finish running the syntax, I have the output with coefficients for each of the independent variables along with the residuals. My adviser then hand calculated all the predicted values but he wants me to think of an easier way to get the predicted value at each time points. He mentioned the use of -margins- but I am having a hard time getting the results I want. Basically, I want to get all predicted values for each of the racial group (east asian, south asian, etc) by each of the time points, oddly the time points he listed are not integers, rather they are in the log-transferred form, which makes it impossible for -margins- to recognize. Any clues for me please?
Thank you!
xtmixed READ LNAGE5 EASIA_CHILD_BH SEASIA_CHILD_BH SASIA_CHILD_BH USASIA_CHILD_BH BLACK HISP OTHER EASIAxLNAGE5 SEASIAxLNAGE5 SASIAxLNAGE5 /// USASIAxLNAGE5 BLACKxLNAGE5 HISPxLNAGE5 OTHERxLNAGE5 || SCHID:, || CHILDID: LNAGE5, mle cov(un) var pweight(C1_7FC0)
READ is the outcome variable, and LNAGE5 is the log-transferred variable of time (age of students when they took the test). I am not quite sure why he needs to do so but I did try running the syntax using the original time variable but stata gives me error messages. Anyone knows why? The rest of the independent variables are student race, and the interaction between student race and time points. My second question is once I finish running the syntax, I have the output with coefficients for each of the independent variables along with the residuals. My adviser then hand calculated all the predicted values but he wants me to think of an easier way to get the predicted value at each time points. He mentioned the use of -margins- but I am having a hard time getting the results I want. Basically, I want to get all predicted values for each of the racial group (east asian, south asian, etc) by each of the time points, oddly the time points he listed are not integers, rather they are in the log-transferred form, which makes it impossible for -margins- to recognize. Any clues for me please?
Thank you!
Comment