Hello
I use the following codes to generate r2small r2large over 6 pre-specified periods and the final output is a long list of years from 1962-2017 (my sample period).
I was wondering if there is a way to obtain, as a final output, something like a list of 6 sub-periods and corresponding r2small r2large ?
I use the following codes to generate r2small r2large over 6 pre-specified periods and the final output is a long list of years from 1962-2017 (my sample period).
I was wondering if there is a way to obtain, as a final output, something like a list of 6 sub-periods and corresponding r2small r2large ?
Code:
gen period = floor((year-1962)/10) + 1 tabstat year, by(period) statistics(min max) gen r2small =. forvalues i = 1/6 { display "`i'" reg prc atpr capxpr ceqpr chpr cogspr dvcpr intanpr ibpr oancfpr revtpr spipr xadpr xrdpr xsgapr revgrowpr ocipr if period == `i' & size == 0 replace r2small = e(r2_a) if period == `i' } gen r2large =. forvalues i = 1/6 { display "`i'" reg prc atpr capxpr ceqpr chpr cogspr dvcpr intanpr ibpr oancfpr revtpr spipr xadpr xrdpr xsgapr revgrowpr ocipr if period == `i' & size == 2 replace r2large = e(r2_a) if period == `i' } keep pyear r2small r2large duplicates drop sort pyear
Comment