Should I use ANOVA or t
A second study design is to recruit a group of individuals and then split them into groups based on some independent variable. Again, each individual will be assigned to one group only. This independent variable is sometimes called an attribute independent variable because you are splitting the group based on some attribute that they possess (e.g., their level of education; every individual has a level of education, even if it is "none"). Each group is then measured on the same dependent variable having undergone the same task or condition (or none at all). For example, a researcher is interested in determining whether there are differences in leg strength between amateur, semi-professional and professional rugby players. The force/strength measured on an isokinetic machine is the dependent variable. This type of study design is illustrated schematically in the Figure below:
SAS has the UNIVARIATE, MEANS, and TTEST procedures for t-test, while SAS ANOVA, GLM, and MIXED procedures conduct ANOVA.
The ANOVA procedure is able to handle balanced data only, but the GLM and MIXED procedures can deal with both balanced and unbalanced data. The t-test and one-way ANOVA do not matter whether data are balanced or not.
STATA has the
It is useful to read multiple observations in a data line. Note that @@ is a line holder in SAS.
LIBNAME js 'c:\data\sas';
The DO statement allows to read more complicated data. You may list the particular numbers in the DO statement rather than set a range of values (e.g., DO treatment=1 TO 2;). The @ may not be omitted. This tip is very useful especially when you type in data for the randomized complete block design (RCB) and the Latin square design (LSD).
If data are arranged in the long format, you need to rearranged into the wide format.
STATA has the
. list, noobs
One Sample T-Test
The MU0 option specifies a value of the null hypothesis. The ALPHA option specifies the significance level. The T option in the MEANS procedure runs the t-test.
PROC UNIVARIATE MU0=0 ALPHA=.01;
PROC UNIVARIATE MU0=10 VARDEF=DF NORMAL ALPHA=.05;
PROC MEANS T PROBT;
PROC MEANS MEAN STD STDERR T VARDEF=DF PROBT CLM ALPHA=.01;
Note that STATA
Two Independent Samples T-Test
The TTEST procedure reports two T statistics: one under the equal variance assumption and the other for unequal variance. Users have to check the equal variance test (F test) first. If not rejected, read the T statistic and its p-value of pooled analysis. If rejected, read the T statistic and its p-value of Satterthwaite or Cochran/Cox approximation.
PROC TTEST COCHRAN;
STATA is able to conduct the t-test for two independent samples even When data are arranged in two variables without a group variable. The unpaired option indicates that the two variables are independent, and the welch option asks STATA produces Welch approximation of degree of freedom. Note STATA does not give us Cochran/Cox approximation.
. ttest response1=response2, unpaired level(99)
T-Test on Aggregate Data
The FREQ statement in the TTEST procedure can handle aggregate data
PROC TTEST H0=5 ALPHA=.01;
. ttesti 30 4.5 0.54 // One sample T-test
Randomized Complete Block (RCB): Treatments are assigned at random within blocks of adjacent subjects, each treatment once per block. The number of blocks is the number of replications. Any treatment can be adjacent to any other treatment, but not to the same treatment within the block.
Again, the ANOVA, GLM, and MIXED conduct the two-way ANOVA with the identical usage.
In the case of the randomized complete block design, you may have one observation in each cell. So, including an interaction term is meaningless, producing awkward results. But it is noteworthy that the sum of squares due to error (SSE) is equivalent to the sum of squares of interaction (SSI).
You may compare group means using the MEANS or the LSMEANS (least squares means) statement. The LSMEANS statement is not available in the ANOVA procedure.
Why can't I just use t
The key difference between ANOVA and T-test is that ANOVA is applied to test the means of more than two groups. In contrast, a t-test is only used when the researcher compares or analyzes two data groups or population samples.
Why should we use an ANOVA rather than lots of t
The t-test is a method that determines whether two populations are statistically different from each other, whereas ANOVA determines whether three or more populations are statistically different from each other.
Is ANOVA the same as t
The t-test and ANOVA examine whether group means differ from one another. The t-test compares two groups, while ANOVA can do more than two groups.
Does ANOVA and t
ANOVA uses the F distribution, a t test uses the t distribution. The F is a squared t, therefore they will always give the answer to the same question.