Hello everyone,
I am trying to model the line of the intersect between the equation Y = a + b1.X1 + b2.X2 and the plane Y = X1 as well the corresponding confidence interval. I adopted a naïve approach to compute the confidence interval (see below) but I guess that there are some joint effects that I would need to take into account in order to compute the CI properly.
Any help would be much appreciated
Many thanks,
Bill
*Regression
***********
reg Y X1 X2
Source | SS df MS Number of obs = 945,022
-------------+---------------------------------- F(2, 945019) > 99999.00
Model | 90481.2975 2 45240.6488 Prob > F = 0.0000
Residual | 347431.487 945,019 .367644976 R-squared = 0.2066
-------------+---------------------------------- Adj R-squared = 0.2066
Total | 437912.785 945,021 .463389475 Root MSE = .60634
------------------------------------------------------------------------------
Y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
X1 | .3874265 .0007882 491.52 0.000 .3858816 .3889714
X2 | -.009871 .0004478 -22.04 0.000 -.0107488 -.0089933
_cons | 5.631819 .0083529 674.24 0.000 5.615447 5.64819
------------------------------------------------------------------------------
*Standard Errors
****************
local a_err = invttail(e(df_r),0.025)*_se[_cons]
local b1_err = invttail(e(df_r),0.025)*_se[X1]
local b2_err = invttail(e(df_r),0.025)*_se[X2]
*Gen intersect and CI
*********************
gen intersect = (_b[_cons]+_b[X2]*X2)/(1-_b[X1])
gen intersect_lower = ((_b[_cons]-`a_err')+(_b[X2]-`b2_err'*X2)/(1-(_b[X1]-`b1_err'))
gen intersect_upper = ((_b[_cons]-`a_err')+(_b[X2]-`b2_err'*X2)/(1-(_b[X1]-`b1_err'))
Related Posts with Joint Standard Errors of Regression
Interpreting coefficients (percentage points vs percentage)I was reading a paper that ran a difference-in-differences regression and the coefficient value was …
How can I get several variables' mean values at the smaeI want to create a vector containing several variables' mean values. But the summarize command only …
Old bugDear All, I hope someone following Stata for many years can help me with remembering: there used to…
What is a GROUP variable in difference in differences analysis?Query: What is a GROUP variable in difference in differences analysis? Study: Newspaper articles fr…
Interpreting coefficients (percentage vs percentage points)I was reading a paper that ran a difference-in-differences regression and the coefficient value was …
Subscribe to:
Post Comments (Atom)
0 Response to Joint Standard Errors of Regression
Post a Comment