Hi, You can use the car package and choose Type-III test. Also, have a look at the package easyanova. Regards, José
José Iparraguirre Chief Economist Age UK -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of humming-bird Sent: 27 November 2012 10:12 To: r-help@r-project.org Subject: [R] Anova Hi everyone, I am new to this forum and also new to statistics and I would appreciated it if someone would take some time to answer my question. I am analyzing companies in regard to their leverage. I categorized the companies into 3 groups: small, mid and large. For the group small, I have 55 debt multiples, for mid 42 and for large 72. (Unfortunately I can not provide my data because it is confidential.) I am now trying to find out whether the mean debt multiples are significantly different for the 3 different groups. For this reason I calculated an anova table with the aov function and to display the results for each "pair" I did the tukey.hsd function. Now my question: Am I allowed to use these functions given that my data is unbalanced? Can use I read several times that aov is only valid for balanced data? If not, is there another function that I can use? Thank you very much for your answers. Call: aov(formula = Debt.Ebitdax ~ Company.Size, data = Anetdebtx2003) Terms: Company.Size Residuals Sum of Squares 302.3089 926.2174 Deg. of Freedom 2 166 Residual standard error: 2.362123 Estimated effects may be unbalanced > summary(Anovanetdebtx2003) Df Sum Sq Mean Sq F value Pr(>F) Company.Size 2 302.3 151.15 27.09 6.58e-11 *** Residuals 166 926.2 5.58 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > TukeyHSD(Anovanetdebtx2003) Tukey multiple comparisons of means 95% family-wise confidence level Fit: aov(formula = Debt.Ebitdax ~ Company.Size, data = Anetdebtx2003) $Company.Size diff lwr upr p adj Mid Market Buyout-Large Buyout -1.446292 -2.530922 -0.3616617 0.0054123 Small Buyout-Large Buyout -3.112143 -4.112545 -2.1117420 0.0000000 Small Buyout-Mid Market Buyout -1.665852 -2.810574 -0.5211300 0.0021037 -- View this message in context: http://r.789695.n4.nabble.com/Anova-tp4650940.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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. A Star for Christmas Kick start the festive season by attending one of Age UK’s Carol Concerts, A Star for Christmas. Taking place at Manchester Cathedral on Saturday 1 December and London’s St Pancras Church (opposite Euston Station) on Thursday 6 December, they will feature special musical performances, readings by your favourite celebrities and carols, followed by mince pies and wine. Tickets are priced at £20 full price/ £10 concessions. For more information, please visit http://www.ageuk.org.uk/astarforchristmas or contact the Fundraising Events Team on 020 303 31725. Age UK Improving later life www.ageuk.org.uk ------------------------------- Age UK is a registered charity and company limited by guarantee, (registered charity number 1128267, registered company number 6825798). Registered office: Tavis House, 1-6 Tavistock Square, London WC1H 9NA. For the purposes of promoting Age UK Insurance, Age UK is an Appointed Representative of Age UK Enterprises Limited, Age UK is an Introducer Appointed Representative of JLT Benefit Solutions Limited and Simplyhealth Access for the purposes of introducing potential annuity and health cash plans customers respectively. Age UK Enterprises Limited, JLT Benefit Solutions Limited and Simplyhealth Access are all authorised and regulated by the Financial Services Authority. ------------------------------ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you receive a message in error, please advise the sender and delete immediately. Except where this email is sent in the usual course of our business, any opinions expressed in this email are those of the author and do not necessarily reflect the opinions of Age UK or its subsidiaries and associated companies. Age UK monitors all e-mail transmissions passing through its network and may block or modify mails which are deemed to be unsuitable. Age Concern England (charity number 261794) and Help the Aged (charity number 272786) and their trading and other associated companies merged on 1st April 2009. Together they have formed the Age UK Group, dedicated to improving the lives of people in later life. The three national Age Concerns in Scotland, Northern Ireland and Wales have also merged with Help the Aged in these nations to form three registered charities: Age Scotland, Age NI, Age Cymru. ______________________________________________ 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.