Following the format and syntax of the standard t.test
function, the two methods for the generic function smd.t.test
are formula and default. The formula method is invoked when the data include a variable that has exactly two values, a grouping variable or factor generically referred to as X, and a numerical response variable, generically referred to as Y. The formula is of the form Y ~ X, with the names Y and X replaced by the actual variable names specific to a particular analysis. The formula method automatically retrieves the names of the variables and data values for display on the resulting output.The default method is invoked when the values of the response variable Y are organized into two vectors, the values of Y for each group in the corresponding vector. When submitting data in this form, the output is enhanced if the actual names of the variables referred to generically as X and Y, as well as the names of the levels of the factor X, are explicitly provided.
This version of smd.t.test
assumes homogeneity of variance in the computation of the standard error of the mean difference. Also, only a two-sided test is provided. The null hypothesis is a population mean difference of 0.
The bandwidth parameter controls the smoothness of the estimated density curve. To obtain a smoother curve, increase the bandwidth from the default value.
For the output, the two groups are automatically arranged so that the group with the larger mean is listed as the first group. The result is that the resulting mean difference, as well as the standardized mean difference, is always non-negative.
The practical importance of the size of the mean difference is addressed when one of two parameter values are supplied, the minimum mean difference of practical importance, mmd, or the corresponding standardized version, msmd. The remaining value is calculated and both values are added to the graph and the console output.
After running smd.t.test
, the following statistics are available for further analysis: sample sizes n1
and n2
, sample means m1
and m2
, sample standard deviations, s1
and s2
, plus the within-group or pooled standard deviation, sw
. For example, if the t-test does not achieve significance, then perhaps a power curve is of interest. Then n1
, n2
and sw
can be used to construct a power curve without re-entering their values,
powercurve.t.test()
.