So my problem is that i have a dataset of 502 firms but some of them have no observations.
The thing is, i want to include these results into my matrix because otherwise the coefficients, p-values and adjusted R2 are shifted so that the firms don´t have the right values standing next to them in the matrix.
My code is like that:
set matsize 510
unab y : TOYOTAMOTORTOTRETURNIND-COMMUTUREDEADDELIST280910
local l : word count `y'
matrix p = J(`l',3,.)
matrix rownames p = `y'
matrix colnames p = "adjR2" "coef" "p"
matlist p
local i = 1
foreach var of local y {
{
capture noisily reg `var' RenditenTopix PercentageChangeTWEXR if `var'>-1000, robust
if c(rc) ==0 {
matrix p[`i++',1] = (1-(1-e(r2))*(e(df_r)+e(df_m))/(e(df_r))), _b[PercentageChangeTWEXR], 2*ttail(e(df_r), abs(_b[PercentageChangeTWEXR]/_se[PercentageChangeTWEXR]))
}
else if c(rc) !=2000{
exit (c(rc))
}
}
}
matlist p
So thank you very much for your help in advance!
Related Posts with How do i include the results of a no observations regression into a matrix?
'xtoverid' after multiple imputation in panel data?Hello there, I am a first time Stata user and am having a few problems. I already searched in this f…
Reshape data wide to long for xtivregHello, Currently I have panel data in wide form with variables indicating the year at the end, (eg, …
How to generate a new binary variable based on individuals having 2 or more of other risk factorsI would like to create a variable based on individuals being classified as "high risk" or "low risk"…
ANOVA error r(422); "could not determine between-subject basic unit; use bseunit() option" Using bseunit() option, but get this error anywayHello, I'm new to using the ANOVA command (it is not common in my field). A reviewer for a journal …
Power calculations in stataI would like to use the stata power command, to estimate the smallest effect size I would be able to…
Subscribe to:
Post Comments (Atom)
0 Response to How do i include the results of a no observations regression into a matrix?
Post a Comment