I am trying to write a function that tests hypotheses and gives me a nice table but I can't. I need forum's help. For example, I have the following data
data1 = RandomReal[{0, .5}, 100];
I want to test whether the mean of the data is significantly different form zero using t-test and produce a table that has mean of the data and t-value but mean should have *, ** or *** if the mean is significant at 1%,5% and 10% respectively and t-value should be in brackets such [t-value]. If I do the following code:
{If[Quiet[TTest[data1, Automatic, "PValue"]] <= .05, SuperStar[
Mean[data1]], Mean[data1]],
Quiet[TTest[data1, Automatic, "TestStatistic"]]}
I get
However, I am trying to get
based on whether I have P - value <= 0.01 or P - value <= 0.05 or P - value <= 0.1 respectively.
This problem may not look practical but I am trying to apply this function to a data with more than 20000 observations and 6 columns and I have to use the same test to different sub-samples and produce a table with mean and t-values.
Any help is greatly appreciated.
Superscript
. Have a look atToString
andStringJoin
as well. $\endgroup$