Hi Stata members,
I have run the following program to run cross sectional regressions by country and it worked very well,
capture program drop one_year
program define one_year
local outcome spread
unab predictors: tangibility profitabilty secured guaranteed investment_grd size logmat rating corporatedefaultspread vix difference logamount
capture noisily regress `outcome' `predictors'
if c(rc) == 0 {
foreach p of local predictors {
gen b_`p' = _b[`p']
gen se_`p' = _se[`p']
}
gen n_obs = e(N)
gen r2 = e(r2)
exit 0
}
else if inlist(c(rc), 2000, 2001) {
exit 0
}
else {
foreach p of local predictors {
gen b_`p' = .x
gen se_`p' = .x
}
gen n_obs = .x
gen r2 = .x
exit c(rc)
}
end
runby one_year, by(country)
However, I need the P-value for the coefficients, and I have used return list but it did not return any value,
return list
matrix list r(table),
I also tried to calculate the P-value in excel using the T-Distribution function but it returned completely different values than Stata,
so I will appreciate any suggestions to get the p-values with the Stata output,
Thanks for your help,
Related Posts with r(table) with cross-sectional regression
Scatterplot of dates?Hi All, I'm using STATA 15. My question is how do I convert and then format a datetime variable (c…
what a. means in a observation?Hello, I merged two databases and after that, some observations (cells) have a string "a." What does…
repeated time values within panelDear statalisters, I am asking you for help because when I run Code: xtset firm year I receive a …
How to do a margin plot with variables with non integers?Hello, I am trying to do a margin plot with interacion terms, but when I run Code: margins ssr., a…
XtsccDears, I have question regarding XTSCC. As I read this can be used to deal with cross-section depen…
Subscribe to:
Post Comments (Atom)
0 Response to r(table) with cross-sectional regression
Post a Comment