I have MEAN, MEDIAN, NSUB (number of subjects) and SD data coming from different studies and different populations. These are the only available information in the studies. My data set contains the following columns:
STUDY NSUB MEAN MEDIAN SD 1 10 1.5 1.7 0.4 2 20 1.5 1.55 0.3 3 7 2.6 3 0.5 4 15 3 3.01 0.1
And so on.
I want to judge whether the mean and median are significantly different at significance level (alpha=0.05). This is so I can make a decision whether the data from each study were come from a normal or log-normal distribution.
I thought of doing a two sided t-test. My hypothesis would be:
HA: MEAN doesn't equal MEDIAN
The standard error of the mean (SEM) can be calculated as SD/NSUB where NSUB is the number of subjects. The degree of freedom would be NSUB-1. The scenario I am presenting here is as if I am comparing two means that have the same standard deviation (SD).
Is there a way where I can apply this automatically in R for the set of data that I have and have the result added to the data as t.test.result being TRUE/FALSE (significantly different/insignificantly different). Something close to this:
STUDY NSUB MEAN MEDIAN SD t.test.result 1 10 1.5 1.7 0.4 RESULT1? 2 20 1.5 1.55 0.3 RESULT2? 3 7 2.6 3 0.5 RESULT3? 4 15 3 3.01 0.1 RESULT4?
Also, is there a better way to test whether each study population was come from a normal or log-normal distribution?