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
Create variable depending on many variablesHey stata community, I have a question regarding creating a new variable depending on many other va…
Generating change in levels as well as percentages from stataHi All, I have a dataset which resembles the following: x y 1 2 2 4 3 6 I have two variables her…
Specify interaction/square terms with xtabond2 & xtdpdgmmDear all, First of all, I would like to confirm that I have searched and read many posts here but n…
how to separate the result by regionI have a number of variables. the variables are insurance types, a region of address, and another 5 …
Bug in wtmean?This is my first post but I hope I have strictly followed the rules. I have the following data Co…
Subscribe to:
Post Comments (Atom)
0 Response to Joint Standard Errors of Regression
Post a Comment