not sure about your data format, suppose the data have the following variables
y x year
* new var hold results
* residual
gen double res = .
* studentizzed res
gen double sres = .
* take the year value
levelsof year, local(y)
* loop over year
foreach i in `y' {
reg y x if year == `i'
predict double __x, r
predict double __y, rstu
replace res = __x if year==`i'
replace sres = __y i ...
not sure about your data format, suppose the data have the following variables
y x year
* new var hold results
* residual
gen double res = .
* studentizzed res
gen double sres = .
* take the year value
levelsof year, local(y)
* loop over year
foreach i in `y' {
reg y x if year == `i'
predict double __x, r
predict double __y, rstu
replace res = __x if year==`i'
replace sres = __y if year==`i'
drop __x __y
}
You can use stata, but may depend on the size of the data, the version of stata you used. Can you save your data as a stata data and look the size of file (if more than 1GB, using X86 version of stata can have problem). But if you are using X64 and have a large size of memory in your PC, then should be no problem to run your analysis in stata.