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
keyboard shortcut for cycling through tabs in the do-file editorHi there When using the keyboard shortcut (ctrl+tab) in the do-file editor to cycle through tabs, S…
Combining survey questionsDear all I have executed a survey for my master thesis, and now I need to combine the variables reg…
(PPMLhdfe) Question about the feasibility of the resultsHello everybody, I am a completely new user of STATA. I want to estimate the effects of pandemic pr…
Putting a value's label on ExcelI have a variable with different values and I want each of those values in a different row of an exc…
how to organize the output of table with the desending order of frequency rather than the contents of the variable? Code: * Example generated by -dataex-. For more info, type help dataex clear input str32 Country "B…
Subscribe to:
Post Comments (Atom)
0 Response to r(table) with cross-sectional regression
Post a Comment