So, you are looking for confidence intervals for each factor level?
You can use the predict() function to do that.

fit <- aov(values ~ ind, data=otestme)
newdat <- data.frame(ind=factor(levels(otestme$ind)))
cbind(newdat, predict(fit, newdata=newdat, interval="confidence"))

Jean 

Anna Dunietz wrote on 08/23/2011 03:53:51 AM:
> 
> Hi All!
> 
> I am interested in testing whether the means for the data I am 
investigating
> are equal to a specific value - let's say 0.01.  I have already run a
> one-way ANOVA and know that the differences in the means are not
> significant, so now I want to know what values the means take on. 
"otestme"
> is the data I am working with (it would be hard for me to get into a 
form
> that would be easy for you to manipulate, so I have pasted it below - 
values
> is numeric, while ind consists of factors(equities)).  I have also 
pasted
> the results of my ANOVA below, although I do not think you need to see 
them
> in order to answer my question.
> 
> I understand that I should have more observations per each equity, but I 
do
> not want to overflow this e-mail with data.  I have, therefore, taken a
> small sample of all my data.  I hope I have provided enough information 
in
> order for you to understand what I would like to do.  I have researched 
for
> a couple of hours regarding this problem but to no avail!
> 
> Thanks!
> Anna
> 
> 
> > otestme          values              ind
> 1    0.001008012   AAPL.UW.Equity
> 2    0.015518087   AAPL.UW.Equity
> 3    0.013221459   AAPL.UW.Equity
> 4    0.012195734   AAPL.UW.Equity
> 5   -0.026750298   AAPL.UW.Equity
> 6   -0.001910487   AAPL.UW.Equity
> 7   -0.003419938   AAPL.UW.Equity
> 8    0.009316770    BHI.UN.Equity
> 9   -0.007564103    BHI.UN.Equity
> 10  -0.040175688    BHI.UN.Equity
> 11  -0.017900404    BHI.UN.Equity
> 12  -0.010278197    BHI.UN.Equity
> 13  -0.034339518    BHI.UN.Equity
> 14  -0.006739317    BHI.UN.Equity
> 15  -0.013637913    BMY.UN.Equity
> 16  -0.015900449    BMY.UN.Equity
> 17   0.004566210    BMY.UN.Equity
> 18  -0.002097902    BMY.UN.Equity
> 19   0.014716188    BMY.UN.Equity
> 20   0.006560773    BMY.UN.Equity
> 21   0.000343053    BMY.UN.Equity
> 22   0.010712869    COP.UN.Equity
> 23  -0.012823868    COP.UN.Equity
> 24  -0.000132556    COP.UN.Equity
> 25  -0.004242344    COP.UN.Equity
> 26   0.009319664    COP.UN.Equity
> 27  -0.007254980    COP.UN.Equity
> 28  -0.009433962    COP.UN.Equity
> 29  -0.014138817   DELL.UW.Equity
> 30   0.005867014   DELL.UW.Equity
> 31  -0.018146468   DELL.UW.Equity
> 32  -0.002640264   DELL.UW.Equity
> 33  -0.003970880   DELL.UW.Equity
> 34   0.005315615   DELL.UW.Equity
> 35   0.046265697   DELL.UW.Equity
> 36  -0.024477612 DELL.UW.Equity.1
> 37  -0.019583843 DELL.UW.Equity.1
> 38  -0.033083645 DELL.UW.Equity.1
> 39  -0.002582311 DELL.UW.Equity.1
> 40   0.003883495 DELL.UW.Equity.1
> 41   0.018697614 DELL.UW.Equity.1
> 42  -0.000632911 DELL.UW.Equity.1
> 43   0.028893058    FCX.UN.Equity
> 44  -0.000911743    FCX.UN.Equity
> 45   0.020076656    FCX.UN.Equity
> 46   0.005009841    FCX.UN.Equity
> 47  -0.022431903    FCX.UN.Equity
> 48   0.002185394    FCX.UN.Equity
> 49  -0.012538615    FCX.UN.Equity
> 50   0.015815224    FDX.UN.Equity
> 51   0.006496416    FDX.UN.Equity
> 52  -0.017471623    FDX.UN.Equity
> 53   0.007588628    FDX.UN.Equity
> 54   0.020571043    FDX.UN.Equity
> 55  -0.005617359    FDX.UN.Equity
> 56   0.030350022    FDX.UN.Equity
> 57  -0.004484455   GOOG.UW.Equity
> 58   0.012791206   GOOG.UW.Equity
> 59  -0.011949216   GOOG.UW.Equity
> 60   0.019551524   GOOG.UW.Equity
> 61   0.018517603   GOOG.UW.Equity
> 62   0.001213141   GOOG.UW.Equity
> 63   0.005622153   GOOG.UW.Equity
> 64   0.003272557   INTC.UW.Equity
> 65   0.021901212   INTC.UW.Equity
> 66   0.025079799   INTC.UW.Equity
> 67   0.007117438   INTC.UW.Equity
> 68   0.007950530   INTC.UW.Equity
> 69   0.016213848   INTC.UW.Equity
> 70  -0.012074170   INTC.UW.Equity
> 71  -0.012396694     MS.UN.Equity
> 72  -0.025104603     MS.UN.Equity
> 73   0.009442060     MS.UN.Equity
> 74  -0.041666667     MS.UN.Equity
> 75  -0.007985803     MS.UN.Equity
> 76  -0.004919499     MS.UN.Equity
> 77   0.001797753     MS.UN.Equity
> 78   0.010965209    NSC.UN.Equity
> 79  -0.000937333    NSC.UN.Equity
> 80   0.000536121    NSC.UN.Equity
> 81  -0.031346283    NSC.UN.Equity
> 82  -0.001244641    NSC.UN.Equity
> 83   0.010108003    NSC.UN.Equity
> 84   0.002604524    NSC.UN.Equity
> 85  -0.010257403    TGT.UN.Equity
> 86  -0.008799374    TGT.UN.Equity
> 87   0.004931939    TGT.UN.Equity
> 88  -0.002159403    TGT.UN.Equity
> 89  -0.000786937    TGT.UN.Equity
> 90   0.005906675    TGT.UN.Equity
> 91  -0.009786651    TGT.UN.Equity
> 92  -0.002091613    UNH.UN.Equity
> 93  -0.007545588    UNH.UN.Equity
> 94   0.018162619    UNH.UN.Equity
> 95   0.018460900    UNH.UN.Equity
> 96   0.002647658    UNH.UN.Equity
> 97   0.013203331    UNH.UN.Equity
> 98  -0.004009623    UNH.UN.Equity
> 99   0.009640957    WMB.UN.Equity
> 100 -0.016134343    WMB.UN.Equity
> 101  0.000669344    WMB.UN.Equity
> 102 -0.005685619    WMB.UN.Equity
> 103  0.017827111    WMB.UN.Equity
> 104  0.003304693    WMB.UN.Equity
> 105 -0.011198946    WMB.UN.Equity
> 
> 
> 
> > aov(values~ind,data=otestme)Call:
>    aov(formula = values ~ ind, data = otestme)
> 
> Terms:
>                         ind   Residuals
> Sum of Squares  0.004903384 0.018953011
> Deg. of Freedom          14          90
> 
> Residual standard error: 0.01451169
> Estimated effects may be unbalanced>
> summary(aov(values~ind,data=otestme))            Df    Sum Sq    Mean
> Sq F value  Pr(>F)
> ind         14 0.0049034 0.00035024  1.6632 0.07774 .
> Residuals   90 0.0189530 0.00021059
> ---
> Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
> 

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to