If I am completing a 1-way ANOVA (command: oneway outcomevariable independentvariable) and am looking to obtain confidence intervals for the means, how do I go about this?
-
Login or Register
- Log in with
use "C:\Program Files (x86)\Stata15\ado\base\a\auto.dta" . oneway price foreign, tabulate | Summary of Price Car type | Mean Std. Dev. Freq. ------------+------------------------------------ Domestic | 6,072.423 3,097.104 52 Foreign | 6,384.682 2,621.915 22 ------------+------------------------------------ Total | 6,165.257 2,949.496 74 Analysis of Variance Source SS df MS F Prob > F ------------------------------------------------------------------------ Between groups 1507382.66 1 1507382.66 0.17 0.6802 Within groups 633558013 72 8799416.85 ------------------------------------------------------------------------ Total 635065396 73 8699525.97 Bartlett's test for equal variances: chi2(1) = 0.7719 Prob>chi2 = 0.380 . mean price Mean estimation Number of obs = 74 -------------------------------------------------------------- | Mean Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ price | 6165.257 342.8719 5481.914 6848.6 -------------------------------------------------------------- .
* continue with the auto example by Carlo sysuse auto regress price i.foreign Source | SS df MS Number of obs = 74 -------------+---------------------------------- F(1, 72) = 0.17 Model | 1507382.66 1 1507382.66 Prob > F = 0.6802 Residual | 633558013 72 8799416.85 R-squared = 0.0024 -------------+---------------------------------- Adj R-squared = -0.0115 Total | 635065396 73 8699525.97 Root MSE = 2966.4 ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- foreign | Foreign | 312.2587 754.4488 0.41 0.680 -1191.708 1816.225 _cons | 6072.423 411.363 14.76 0.000 5252.386 6892.46 ------------------------------------------------------------------------------
lincom _b[_cons]+_b[1.foreign] ( 1) 1.foreign + _cons = 0 ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 6384.682 632.4346 10.10 0.000 5123.947 7645.417 ------------------------------------------------------------------------------
. margins i.foreign Adjusted predictions Number of obs = 74 Model VCE : OLS Expression : Linear prediction, predict() ------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- foreign | Domestic | 6072.423 411.363 14.76 0.000 5252.386 6892.46 Foreign | 6384.682 632.4346 10.10 0.000 5123.947 7645.417 ------------------------------------------------------------------------------
. regress price ibn.foreign, noconstant noheader ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- foreign | Domestic | 6072.423 411.363 14.762 0.0000 5252.386 6892.460 Foreign | 6384.682 632.435 10.095 0.0000 5123.947 7645.417 ------------------------------------------------------------------------------ . // ibn. = no base level . // noconstant = no constant in the model
sysuse auto statsby , by(rep78): ci means price list, noobs separator(0)
sysuse auto anova price rep78 contrast r.rep78, mcompare(bonferroni) cieffects nowald
Comment