Edit Purpose of my study  I have weather stations collecting data inside and outside low-tech greenhouses. Four of the weather stations are inside, and one is outside. They are collecting temperature, humidity, solar radiation, wind speed, etc. I am testing to see if the differences between the weather station data inside and outside is statistically significant.  Because I have an unequal number of replicates inside and outside the greenhouses, I calculated the difference for each variable between each weather station inside each greenhouse and one weather station outside. This gives me a sample size of 4. Sometimes 3 because I lost a replicate for part of the study. I was hoping to test the significance of the differences from zero rather than the original weather station data.  The shapiro wilk test in R finds that none of my data are from a normal distribution. I am debating whether or not to transform the data and use a t-test or use a non-parametric test. I am leaning towards the latter.  Question Should I log-transform the data and run the t-test or should I find another non-parametric test to use? What are the pros and cons of each? I have done a bit of research, but I'm still unclear on the best approach. Or is there another approach I haven't thought of.  *The post  talks about transformations, but it doesn't compare and contrast them to not transforming your data and using a different test.
34138
Say I have some historical data e.g., past stock prices, airline ticket price fluctuations, past financial data of the company...  Now someone (or some formula) comes along and says "let's take/use the log of the distribution" and here's where I go WHY?  Questions:   WHY should one take the log of the distribution in the first place? WHAT does the log of the distribution 'give/simplify' that the original distribution couldn't/didn't? Is the log transformation 'lossless'? I.e., when transforming to log-space and analyzing the data, do the same conclusions hold for the original distribution? How come? And lastly WHEN to take the log of the distribution? Under what conditions does one decide to do this?   I've really wanted to understand log-based distributions (for example lognormal) but I never understood the when/why aspects - i.e., the log of the distribution is a normal distribution, so what? What does that even tell and me and why bother? Hence the question!  UPDATE: As per @whuber's comment I looked at the posts and for some reason I do understand the use of log transforms and their application in linear regression, since you can draw a relation between the independent variable and the log of the dependent variable. However, my question is generic in the sense of analyzing the distribution itself - there is no relation per se that I can conclude to help understand the reason of taking logs to analyze a distribution. I hope I'm making sense :-/  In regression analysis you do have constraints on the type/fit/distribution of the data and you can transform it and define a relation between the independent and (not transformed) dependent variable. But when/why would one do that for a distribution in isolation where constraints of type/fit/distribution are not necessarily applicable in a framework (like regression). I hope the clarification makes things more clear than confusing :)  This question deserves a clear answer as to "WHY and WHEN"
66117
I have a data set with tens of thousands of observations of medical cost data.  This data is highly skewed to the right and has a lot of zeros.  It looks like this for two sets of people (in this case two age bands with > 3000 obs each):   Min.  1st Qu.   Median     Mean  3rd Qu.     Max.   0.0      0.0      0.0   4536.0    302.6 395300.0  Min.  1st Qu.   Median     Mean  3rd Qu.     Max.   0.0      0.0      0.0   4964.0    423.8 721700.0    If I perform Welch's t-test on this data I get a result back:  Welch Two Sample t-test  data:  x and y t = -0.4777, df = 3366.488, p-value = 0.6329 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval:  -2185.896  1329.358 sample estimates: mean of x mean of y   4536.186  4964.455    I know its not correct to use a t-test on this data since its so badly non-normal.  However, if I use a permutation test for the difference of the means, I get nearly the same p-value all the time (and it gets closer with more iterations).  Using perm package in R and permTS with exact Monte Carlo      Exact Permutation Test Estimated by Monte Carlo  data:  x and y p-value = 0.6188 alternative hypothesis: true mean x - mean y is not equal to 0 sample estimates: mean x - mean y        -428.2691   p-value estimated from 500 Monte Carlo replications 99 percent confidence interval on p-value:  0.5117552 0.7277040    Why is the permutation test statistic coming out so close to the t.test value?  If I take logs of the data then I get a t.test p-value of 0.28 and the same from the permutation test.  I thought the t-test values wold be more garbage than what I am getting here.  This is true of many other data sets I have like this and am wondering why the t-test appears to be working when it shouldn't.  My concern here is that the individual costs are not i.i.d.  There are many sub-groups of people with very different cost distributions (women vs men, chronic conditions etc) that seem to voilate the iid requirement for central limit theorem, or should I not worry about that?
9632
I'm examining a part of my dataset containing 46840 double values ranging from 1 to 1690 grouped in two groups. In order to analyze the differences between these groups I started by examining the distribution of the values in order to pick the right test.  Following a guide on testing for normality, I did a qqplot, histogram &amp; boxplot.       This doesn't seem to be a normal distribution. Since the guide states somewhat correctly that a purely graphical examination isn't sufficient I also want to test the distribution for normality.   Considering the size of the dataset and the limitation of the shapiro-wilks test in R , how should the given distribution be tested for normality and considering the size of the dataset, is this even reliable? ()  Edit:  The limitation of the Shapiro-Wilk test I'm referring to is that the dataset to be tested is limited to 5000 points.  To cite  concerning this topic:     An additional issue with the Shapiro-Wilk's test is that when you feed   it more data, the chances of the null hypothesis being rejected   becomes larger. So what happens is that for large amounts of data even   very small deviations from normality can be detected, leading to   rejection of the null hypothesis event hough for practical purposes   the data is more than normal enough.      [...] Luckily shapiro.test protects the user from the above described   effect by limiting the data size to 5000.   As to why I am testing for normal distribution in the first place:  Some hypothesis tests assume normal distribution of the data. I want to know whether or not I can use these tests.
15072
There is a very confusing question in my mind. I have data, and would like to compare numeric scores between men and women.  There is a big difference in those two groups: the number of men is 34, while the number of women is 310, and variances are not equal.  As far as I know, when the variances are not equal, I can use the Welch–Satterthwaite equation (independent t-test assuming unequal variances). My question is: can I still use this equation although there is a really big difference in sample size between my two samples? Or is there a certain limit for the difference in sample size between two samples?
27030
I did a normality test for my data and as usual, SPSS will give both Shapiro-Wilk and Kolmogorov-Smirnov numbers. Is it okay if I choose to use only the number from Shapiro-Wilk? because the number from SW is the ones that showed significant level (0.183)  while KS is not (0.046). is there any references that I can use to support my decision as to using only SW when both SW and KS were given? thanks.
53263
I want to do an AB test to check if one version does significantly increase revenue. Generically speaking I want to test whether the central tendency (mean) of 2 groups are different from each other on the basis of (unpaired) samples of the 2 groups.   My understanding is, that I could use the following approaches:   Student-t test, if the variance of both groups are the same and both are normally distributed Welch-t test (unequal variance t-test), if the variance of both groups might not be the same but both are still normally distributed Mann–Whitney U test (Wilcoxon rank-sum test), if I cannot make any assumptions about the distribution of both groups   But now I read () that I can always use the Welch-t test. The article argues that it is dangerous to make the assumption of equal variance and additionally that     the unequal variance t-test performs as well as, or better than, the Student's t-test in terms of control of both Type I and Type II error rates whenever the underlying distributions are normal.   And if the groups are not normally distributed, than I can just rank the data beforehand:     Thus, Zimmerman and Zumbo (1993) suggest that the unequal variance t-test can effectively replace the Mann–Whitney U test if the data are first ranked before the test is applied.    So the end conclusion is:     If you want to compare the central tendency of 2 populations based on samples of unrelated data, then the unequal variance t-test should always be used in preference to the Student's t-test or Mann–Whitney U test. To use this test, first examine the distributions of the 2 samples graphically. If there is evidence of nonnormality in either or both distributions, then rank the data. Take the ranked or unranked data and perform an unequal variance t-test.   So my question is:  Do you see any drawbacks in always using the Welch-t test instead of the Student-t test or Mann-Whitney test?
51930
Suppose I have 20 mice. I pair the mice in some way, so that I get 10 pairs. For the purpose of this question, it could be a random pairing, OR it could be a sensible pairing, like trying to pair mice from the same litter, of the same sex, with similar weight, OR it could be a deliberately stupid pairing like trying to pair mice with weights as unequal as they could possibly be. I then use random numbers to assign one mouse in each pair to the control group and the other mouse to the to-be-treated group. I now do the experiment, treating only the to-be-treated mice, but otherwise paying no attention whatsoever to the arrangements just made.  When one comes to analyze the results, one could either use unpaired t-testing or paired t-testing. In what way, if any, will the answers differ? (I'm basically interested in systematic differences of any statistical parameter that needs to be estimated.)  The reason I ask this is that a paper I was recently involved with was criticized by a biologist for using a paired t-test rather than an unpaired t-test. Of course, in the actual experiment, the situation was not as extreme as the situation I've sketched, and there were, in my opinion, good reasons for pairing. But the biologist didn't agree.  It seems to me that it's not possible to incorrectly improve statistical significance (decrease p-value), in the circumstances I sketched, by using a paired t-test, rather than an unpaired test, even if it is inappropriate to pair. It could however worsen statistical significance if mice were badly paired. Is this right?
73399
A woman I was working for asked me to do a one-way ANOVA on some data. I replied that the data were repeated measures (time series) data, and that I thought the assumption of independence was violated. She replied that I should not worry about the assumptions, just do the test and she would take into account that the assumptions might not have been met.  That did not seem right to me. I did some research, and found this wonderful blog post by David Robinson, , which exposed me to the No Free Lunch Theorem. I have looked at the original paper and some follow on stuff, and frankly the math is a bit over my head.  The gist of it -- according to David Robinson -- seems to be that the power of a statistical test comes from its assumptions. And he gives two great examples. As I wade through the other articles and blog posts about it, it seems to always be referenced in terms of either supervised learning or search.  So my question is, does this theorem apply to statistical tests in general? In other words, can one say that the power of a t-test or ANOVA comes from its adherence to the assumptions, and cite the No Free Lunch Theorem?   I owe my former boss a final document regarding the work I did, and I would like to know if I can reference the No Free Lunch Theorem in stating that you cannot just ignore the assumptions of a statistical test and say you'll take that into account when evaluating the results.
114552
I am working on my master thesis at the moment and planned on running the statistics with SigmaPlot. However, after spending some time with my data I came to the conclusion that SigmaPlot might not be fit for my problem (I may be mistaken) so I started my first attempts in R, which did not exactly make it easier.  The plan was to run a simple TWO-WAY-ANOVA on my data which results from 3 different proteins and 8 different treatments on those, so my two factors are proteins and treatments. I tested for normality using both  &gt; shapiro.test(time)   and  &gt; ks.test(time, "norm", mean=mean(time), sd=sqrt(var(time)))   In both cases (maybe not surprising) I ended up with a non-normal distribution.  Which left me with the first questions of which test to use for equality of variances. I came up with  &gt; chisq.test(time)   and the result was, that I don't have equality of variance in my data either.  I tried different data transformations (log, center, standardization), all of which did not solve my problems with the variances.  Now I am at a loss, how to conduct the ANOVA for testing which proteins and which treatments differ significantly from each other. I found something about a Kruskal-Walis-Test, but only for one factor (?). I also found things about ranking or randamization, but not yet how to implement those techniques in R.  Does anyone have a suggestion what I should do?  Edit: thank you for your answers, I am a little overwhelmed by the reading (it just seems getting more and more instead of less), but I will of course keep going.  Here an example of my data, as suggested (I am very sorry for the format, I couldn't figure out another solution or place to put a file. I am still new to this all.):    protein treatment   time   A   con 2329.0   A   HY  1072.0   A   CL1 4435.0   A   CL2 2971.0   A   CL1-HY sim  823.5   A   CL2-HY sim  491.5   A   CL1+HY mix  2510.5   A   CL2+HY mix  2484.5   A   con 2454.0   A   HY  1180.5   A   CL1 3249.7   A   CL2 2106.7   A   CL1-HY sim  993.0   A   CL2-HY sim  817.5   A   CL1+HY mix  1981.0   A   CL2+HY mix  2687.5   B   con 1482.0   B   HY  2084.7   B   CL1 1498.0   B   CL2 1258.5   B   CL1-HY sim  1795.7   B   CL2-HY sim  1804.5   B   CL1+HY mix  1633.0   B   CL2+HY mix  1416.3   B   con 1339.0   B   HY  2119.0   B   CL1 1093.3   B   CL2 1026.5   B   CL1-HY sim  2315.5   B   CL2-HY sim  2048.5   B   CL1+HY mix  1465.0   B   CL2+HY mix  2334.5   C   con 1614.8   C   HY  1525.5   C   CL1 426.3   C   CL2 1192.0   C   CL1-HY sim  1546.0   C   CL2-HY sim  874.5   C   CL1+HY mix  1386.0   C   CL2+HY mix  364.5   C   con 1907.5   C   HY  1152.5   C   CL1 639.7   C   CL2 1306.5   C   CL1-HY sim  1515.0   C   CL2-HY sim  1251.0   C   CL1+HY mix  1350.5   C   CL2+HY mix  1230.5
99953
Situation: Comparing mean scores of level of satisfaction across multiple institutions and overall.   Let's say there are 50 institutions, all with different sample sizes.   Level of satisfaction is rated 1 to 5.  I was asked to perform a t-Test to determine outliers and significance of the score differences, with a control range for 1 SD and 2 SD.   Eg. Institute = Mean score  Institute A = 3.8 Institute B = 3.9 Institute C = 4.1 . . . Overall = 4.0  This is so that we can rank the institutions based on their mean score.  So here's my question:   How do I make a fair comparison of the mean scores? It is possible? How does a t-Test determine statistical significance in this scenario? Do I look at P-value or overlap in distribution to assess usefulness of the test?  I conducted multiple t-Tests for 2 groups (eg. Institute A &amp; Overall, Institute B &amp; Overall, Institute C &amp; Overall, ...) but I'm aware that it is not appropriate to conduct multiple t-Tests comparing 2 groups at a time. What should I do?   Please kindly help. I am quite lost and confused.
92534
I wonder if there is any statistical test to "test" the significance of a bimodal distribution. I mean, How much my data meets the bimodal distribution or not? If so, is there any test in the R program?
45550
I have data that were collected at a number of sites, and each site was located within one of three zones (Lake Ontario, Erie and the St. Lawrence), so I was hoping to do nested ANOVAs to compare between sites and zones. Unfortunately I have an unequal number of sites in each zone (3, 4 and 5 respectively) due to not enough data being collected at a couple sites. Also, my variances and sample sizes are also not equal between sites (sample size running from 3 to 43, I know, terrible!). The total number of observations for all sites was 182. Most sites had around 15 observations  My question is, is it possible for me to do nested analysis of some sort? I can't find much information on nested analysis with unequal variances.  I have tried transforming, the closest I can get to homoscedasticity is with $x_{new}=\frac{1}{(x+2)}$, and that gives me a $p \approx 0.02$
120007
I have a medical research in which I have two sets of data    Control group: People who have no ailment. Study group: People who have some particular ailment.   Within each category there are subgroups like age, gender, blood pressure ranges, cholesterol ranges, etc.  Now I got a few observations (around 50) for both control group and study group. I have observation of various parameter like blood pressure, cholesterol level etc. I want to prove statistical significance of these parameter (Blood pressure/cholesterol) in study group. What is the best way to do it? Should i use $t$ distribution or normal distribution?  Also when I calculate the $p$-value, should I compare each subgroup in study group (based on range) with corresponding subgroup in control group or calculate $p$-value as a whole for study vs control group?
12896
I am using r and have ~400 observations divided into 3 groups.  Group A contains 199 observations, while B contains 173 and C contains 24. I have generated a boxplot of their corresponding measures and would like to compare the 3rd quartile between them to see if they are significantly different. I've included the boxplot here.  I'm not sure what test I should use to compare the 3rd quartile. Does anyone know?
78130
How do you test for significant differences in skewness across two distributions of citation data, using R? I'm trying to compare the two power-law distributed histograms below (I'm just using histograms to visualize it, the data is not actually reduced to histograms). The sample sizes are 121 and 85 respectively. The skewness is very different (roughly 3 and 6 respectively), but how do I test if this difference is significant?
47837
I have an existing data set that comes from the same group of people before and after they received a treatment.  The data set comes from when participants tested their blood sugar values over a 30 day period before receiving an insulin pump and a 30 day period after receiving an insulin pump. This data was obtained from user logs (archival data) and was not controlled to ensure that they were tested at fixed intervals. Participants tested themselves when they needed to test throughout the day for a period of 30 days.  My goal is to determine whether the average blood sugar across 30 days was different for the before vs after group.   Normally this would be a paired samples t-test but unfortunately the before and after group have an unequal number of data points with the after group having significantly more. People are testing more often after receiving an insulin pump.  What is the correct way to handle this?  I can collapse the data to find a mean for each participant before treatment and after treatment (across all participants) so that the data matches up and then run a paired samples t-test on this data but I think this is not the ideal solution.   Would a one way within subjects ANOVA be the appropriate test to run in this case?
65782
If you want to test whether two variables follow the same distribution, would it be a good test to simply sort both variables, and then check their correlation? If it is high (at least 0.9?), then the variables most likely come from the same distribution.  With distribution here I mean "normal", "chi-square", "gamma" etc.