Greetings Everyone,
I hope you all are doing well. This is Jay and I am a grad student. I have been using STATA for quite a while now. But for two weeks I have been a little confused about a problem, which has been well discussed here on STATALIST regarding "annual growth rates". All the questions which have been previously answered were very helpful and I have used them in my actual work (Thank you for that).
Data Overview:
This is an educational dataset which contains 23 variables and 397,000 observations. Among these multiple variables the key variables are the year, student_grade, and standardized_math_score. The "year" variable is like any other time variable. The range of year [2013-2017]. The student grade level is from 0 - 12. Finally, the standardized test score variable for math is basically z-scores. range from -3 to +3 SD.
Problem/Issue:
Currently, my problem is related to growth rates in terms of standardized test scores. I simply want to calculate the growth for each year from 2013 to 2017 by grade level and year. I am confused because this is a hierarchical dataset. This means for each year (2013-2017) there are 0-12 grade levels and for each grade level, there is a standardized math score and this is all is nested within different schools and then students within those schools (This doesn't matter, because I am only interested in the following variables mentioned above). I am not sure that how can I appropriately utilize the _n, _n-1, and _N notations OR maybe using _n, n-1, and _N syntax/notations is not the right approach (I am not sure).
Current Status:
I have tried to use the information available from previous posted answers regarding calculating growth rates. This is what I have done so far, using the following codes:
Then to report my results, I used the following code to generate a table.
This is what I get in terms of annual growth.
A glimpse of the dataset for the three key variables.
If you think the problem is not stated clearly please let me know, I will try to do my best to make it clear.
I would greatly appreciate your help and suggestion regarding this matter.
Regards,
Jay
Stata Version - 15.1
I hope you all are doing well. This is Jay and I am a grad student. I have been using STATA for quite a while now. But for two weeks I have been a little confused about a problem, which has been well discussed here on STATALIST regarding "annual growth rates". All the questions which have been previously answered were very helpful and I have used them in my actual work (Thank you for that).
Data Overview:
This is an educational dataset which contains 23 variables and 397,000 observations. Among these multiple variables the key variables are the year, student_grade, and standardized_math_score. The "year" variable is like any other time variable. The range of year [2013-2017]. The student grade level is from 0 - 12. Finally, the standardized test score variable for math is basically z-scores. range from -3 to +3 SD.
Problem/Issue:
Currently, my problem is related to growth rates in terms of standardized test scores. I simply want to calculate the growth for each year from 2013 to 2017 by grade level and year. I am confused because this is a hierarchical dataset. This means for each year (2013-2017) there are 0-12 grade levels and for each grade level, there is a standardized math score and this is all is nested within different schools and then students within those schools (This doesn't matter, because I am only interested in the following variables mentioned above). I am not sure that how can I appropriately utilize the _n, _n-1, and _N notations OR maybe using _n, n-1, and _N syntax/notations is not the right approach (I am not sure).
Current Status:
I have tried to use the information available from previous posted answers regarding calculating growth rates. This is what I have done so far, using the following codes:
Code:
# delimit ; bysort std_math_score (year): gen t1= std_math_score - std_math_score[_n-1] / (( std_math_score[_n-1])); #delimit cr
Code:
tabstat t1, statistics( mean ) by(school_year) nototal format(%9.5g)
Code:
school_year | mean ------------+---------- 2013 | -.99331 2014 | -1.0025 2015 | -1.0028 2016 | -1.0143 2017 | -1.0118 -----------------------
A glimpse of the dataset for the three key variables.
Code:
year student_grade std_math_score 2013 3 .1 2013 6 -1.7000000000000002 2013 10 2.8000000000000003 2013 6 .1 2013 9 -.30000000000000004 2013 4 -.2 2013 10 -.5 2013 5 .5 2013 2 -1.5 2013 9 -.30000000000000004 2013 9 -1.7000000000000002 2013 9 .1 2013 4 1.8 2013 6 1.7000000000000002 2013 4 -.7000000000000001 2013 9 0 2013 8 1.8 2013 8 0 2013 6 .30000000000000004 2013 2 .7000000000000001 2013 9 0 2013 4 2.2 2013 4 -.8 2013 8 -.1
I would greatly appreciate your help and suggestion regarding this matter.
Regards,
Jay
Stata Version - 15.1
Comment