The response variable is inr and the independent variable is day. Day has values from 1 to 14, discrete quantitative variable. I noticed that by two different methods to compute the confidence interval for each independent variable value (1 to 14) resulted in different standard errors and confidence interval, as shown below.
The reasons I did this is to get a graph like below. I notice the title "Adjusted". Actually, I don't want to some adjustment in my case. It seems that the Stata has made the adjustment, which might be the cause for difference in confidence interval. There is only one independent variable -- "day", but the linear regression analysis listed 13 variables. That's the cause, right?
Code:
. regress inr i.day Source | SS df MS Number of obs = 690 -------------+---------------------------------- F(13, 676) = 18.76 Model | 37.8816699 13 2.9139746 Prob > F = 0.0000 Residual | 105.006267 676 .155334715 R-squared = 0.2651 -------------+---------------------------------- Adj R-squared = 0.2510 Total | 142.887937 689 .207384524 Root MSE = .39413 ------------------------------------------------------------------------------ inr | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- day | 2 | .2573988 .0679332 3.79 0.000 .1240134 .3907842 3 | .5258266 .0676578 7.77 0.000 .392982 .6586713 4 | .6791819 .0668741 10.16 0.000 .5478759 .8104878 5 | .7021678 .0666261 10.54 0.000 .5713488 .8329868 6 | .6818289 .0668741 10.20 0.000 .550523 .8131349 7 | .6358363 .0679332 9.36 0.000 .5024509 .7692217 8 | .654484 .070796 9.24 0.000 .5154774 .7934906 9 | .6719555 .0761594 8.82 0.000 .5224181 .8214928 10 | .6234164 .0785541 7.94 0.000 .4691769 .7776559 11 | .6855143 .0830357 8.26 0.000 .5224754 .8485532 12 | .7540113 .0916581 8.23 0.000 .5740425 .93398 13 | .9027113 .1090699 8.28 0.000 .6885549 1.116868 14 | .9362113 .1331213 7.03 0.000 .6748303 1.197592 | _cons | 1.114789 .0467741 23.83 0.000 1.022949 1.206629 ------------------------------------------------------------------------------ . margins i.day Adjusted predictions Number of obs = 690 Model VCE : OLS Expression : Linear prediction, predict() ------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- day | 1 | 1.114789 .0467741 23.83 0.000 1.022949 1.206629 2 | 1.372187 .0492657 27.85 0.000 1.275455 1.46892 3 | 1.640615 .0488852 33.56 0.000 1.54463 1.736601 4 | 1.793971 .0477947 37.53 0.000 1.700127 1.887815 5 | 1.816957 .0474471 38.29 0.000 1.723795 1.910118 6 | 1.796618 .0477947 37.59 0.000 1.702774 1.890462 7 | 1.750625 .0492657 35.53 0.000 1.653893 1.847357 8 | 1.769273 .0531438 33.29 0.000 1.664926 1.87362 9 | 1.786744 .0601035 29.73 0.000 1.668732 1.904756 10 | 1.738205 .0631105 27.54 0.000 1.614289 1.862121 11 | 1.800303 .0686084 26.24 0.000 1.665592 1.935014 12 | 1.8688 .0788251 23.71 0.000 1.714029 2.023571 13 | 2.0175 .0985313 20.48 0.000 1.824036 2.210964 14 | 2.051 .1246333 16.46 0.000 1.806285 2.295715 ------------------------------------------------------------------------------ . sort day . ci means inr in 1/71 Variable | Obs Mean Std. Err. [95% Conf. Interval] -------------+--------------------------------------------------------------- inr | 71 1.114789 .0099977 1.094849 1.134729 .
Comment