Hi, thanks for all your suggestions. It is realy helpful. The data was not paired. Sorry for a wrong set number of sample, compared to the sample I used for tests. Best Liu
Wayne Jones <[EMAIL PROTECTED]> wrote: Hi Kan Lui, I've had a quick look at the data. The logged data seems reasonably nicely distributed (roughly symmetrical + equal variance). Indeed the y variable passed the (very strict) shapiro.test for normality. However the main problem is that I do not get the same results as you for the significance of the t.test. The only significant test I see is the paired t.test on the logged data. Is your data paired data? To see what I mean check out: http://www.texasoft.com/winkpair.html The non-parametric tests show no significance (paired data or not) (logged and natural data). Although in general they do tend to be less strict than parametric tests. Unless the data is paired then the means of these samples most certainly do not significantly differ from one another. Here are my workings: Temp.Dat<-read.table("data_natural.txt",header=T) hist(log(Temp.Dat$x,10)) hist(log(Temp.Dat$y,10)) shapiro.test(log(Temp.Dat$x,10)) shapiro.test(log(Temp.Dat$y,10)) t.test(log(Temp.Dat$x,10), log(Temp.Dat$y,10)) Welch Two Sample t-test data: log(Temp.Dat$x, 10) and log(Temp.Dat$y, 10) t = 0.9126, df = 195.806, p-value = 0.3626 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -0.0599837 0.1633168 sample estimates: mean of x mean of y 4.891313 4.839647 > t.test(log(Temp.Dat$x,10), log(Temp.Dat$y,10),paired=T) Paired t-test data: log(Temp.Dat$x, 10) and log(Temp.Dat$y, 10) t = 2.3535, df = 98, p-value = 0.02060 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.008101002 0.095232132 sample estimates: mean of the differences 0.05166657 > wilcox.test(log(Temp.Dat$x,10), log(Temp.Dat$y,10),paired=T) Wilcoxon signed rank test with continuity correction data: log(Temp.Dat$x, 10) and log(Temp.Dat$y, 10) V = 2972.5, p-value = 0.0828 alternative hypothesis: true mu is not equal to 0 > wilcox.test(log(Temp.Dat$x,10), log(Temp.Dat$y,10),paired=F) Wilcoxon rank sum test with continuity correction data: log(Temp.Dat$x, 10) and log(Temp.Dat$y, 10) W = 5206, p-value = 0.4491 alternative hypothesis: true mu is not equal to 0 > wilcox.test(Temp.Dat$x, Temp.Dat$y,paired=F) Wilcoxon rank sum test with continuity correction data: Temp.Dat$x and Temp.Dat$y W = 5206, p-value = 0.4491 alternative hypothesis: true mu is not equal to 0 > wilcox.test(Temp.Dat$x, Temp.Dat$y,paired=T) Wilcoxon signed rank test with continuity correction data: Temp.Dat$x and Temp.Dat$y V = 2896.5, p-value = 0.1417 alternative hypothesis: true mu is not equal to 0 > t.test(Temp.Dat$x, Temp.Dat$y,paired=T) Paired t-test data: Temp.Dat$x and Temp.Dat$y t = 1.6731, df = 98, p-value = 0.0975 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -2351.81 27623.53 sample estimates: mean of the differences 12635.86 > t.test(Temp.Dat$x, Temp.Dat$y,paired=F) Welch Two Sample t-test data: Temp.Dat$x and Temp.Dat$y t = 0.6432, df = 191.177, p-value = 0.5209 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -26116.18 51387.89 sample estimates: mean of x mean of y 120544.9 107909.0 > -----Original Message----- From: kan Liu [mailto:[EMAIL PROTECTED] Sent: 22 September 2004 10:22 To: Andrew Robinson; Dimitris Rizopoulos Cc: [EMAIL PROTECTED] Subject: Re: [R] t test problem? Hi, Many thanks for your helpful comments and suggestions. The attached are the data in both log10 scale and original scale. It would be very grateful if you could suggest which version of test should be used. By the way, how to check whether the variation is additive (natural scale) or multiplicative (log scale) in R? How to check whether the distribution of the data is normal? PS, Can I confirm that do your suggestions mean that in order to check whether there is a difference between x and y in terms of mean I need check the distribution of x and that of y in both natual and log scales and to see which present normal distribution? and then perform a t test using the data scale which presents normal distribution? If both scales present normal distribution, then the t tests with both scales should give the similar results? Thanks again. Liu Andrew Robinson <[EMAIL PROTECTED]> wrote: Hi Dimitris, you are describing a more stringent requirement than the t-test actually requires. It's the sampling distribution of the mean that should be normal, and this condition is addressed by the Central Limit Theorem. Whether or not the CLT can be invoked depends on numerous factors, including the distribution of the sample, and the size of the sample, neither of which we have any information about. Liu, the problem you describe is associated with the application of the test rather than the test itself. The difference between log- and natural- scaled data can often profitably be thought about by asking whether you would naturally assume that the variation is additive (natural scale) or multiplicative (log scale). Given the information that you've presented there's no way we can tell which version of the test is more reliable. I hope that this helps. Andrew On Wed, Sep 22, 2004 at 10:00:16AM +0200, Dimitris Rizopoulos wrote: > Hi Liu, > > before applying a t-test (or any test) you should first check if the > assumptions of the test are supported by your data, i.e., in a t-test > x and y must be normally distributed. > > I hope it helps. > > Best, > Dimitris > > ---- > Dimitris Rizopoulos > Ph.D. Student > Biostatistical Centre > School of Public Health > Catholic University of Leuven > > Address: Kapucijnenvoer 35, Leuven, Belgium > Tel: +32/16/396887 > Fax: +32/16/337015 > Web: http://www.med.kuleuven.ac.be/biostat/ > http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm > > > ----- Original Message ----- > From: "kan Liu" > To: > Sent: Wednesday, September 22, 2004 9:52 AM > Subject: [R] t test problem? > > > >Hello, > > > >I got two sets of data > >x=(124738, 128233, 85901, 33806, ...) > >y=(25292, 21877, 45498, 63973, ....) > >When I did a t test, I got two tail p-value = 0.117, which is not > >significantly different. > > > >If I changed x, y to log scale, and re-do the t test, I got two tail > >p-value = 0.042, which is significantly different. > > > >Now I got confused which one is correct. Any help would be very > >appreciated. > > > >Thanks, > >Liu > > > >__________________________________________________ > > > > > > > >[[alternative HTML version deleted]] > > > >______________________________________________ > >[EMAIL PROTECTED] mailing list > >https://stat.ethz.ch/mailman/listinfo/r-help > >PLEASE do read the posting guide! > >http://www.R-project.org/posting-guide.html > > > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html -- Andrew Robinson Ph: 208 885 7115 Department of Forest Resources Fa: 208 885 6226 University of Idaho E : [EMAIL PROTECTED] PO Box 441133 W : http://www.uidaho.edu/~andrewr Moscow ID 83843 Or: http://www.biometrics.uidaho.edu No statement above necessarily represents my employer's opinion. --------------------------------- KSS Ltd Seventh Floor St James's Buildings 79 Oxford Street Manchester M1 6SS England Company Registration Number 2800886 Tel: +44 (0) 161 228 0040 Fax: +44 (0) 161 236 6305 mailto:[EMAIL PROTECTED] http://www.kssg.com The information in this Internet email is confidential and m...{{dropped}} ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html