Description Usage Arguments Details Author(s) References Examples
Returns a t-value based on the given contrast weights Same as yuen.contrast (see Ryne's code, not implemented in russmisc) only no trimming is allowed. Created largely for sanity checks, yuen.contrast should generally be used.
1 2 3 4 5 |
DV |
A numeric vector of the same length as IV containing the measured values. |
IV |
A factor of the same length as DV containing the independent variable codes. |
wgt |
A numeric vector containing the contrast weights corresponding to each successive level of the IV. If this value is left NULL, the function will try to use the |
alpha |
A numeric element > .00 and < 1.00 specifying the Type I error rate. |
EQVAR |
A logical indicating whether equal variances amongst the groups should be assumed. |
alternative |
A character vector specifying the alternative hypothesis. Must be one of "unequal", "greater", or "less". |
x |
an object used to select the method. |
... |
further arguments passed to or from other methods. |
This function computes a t-value for a DV given a set of
contrast weights following Rosenthal, Rosnow, & Rubin (2000). If EQVAR=FALSE
then degrees of freedom are calculated using Welch's method. The wgt option
allows one to specify contrast weights to test hypotheses with more than
2 levels of an IV. By default it tests the hypothesis that the sum of the wgt
vector times the DV means for each IV is greater than 0.
To get a two-tailed p-value or one predicting a negative contrast,
change the alternative
parameter.
Ryne Sherman <rsherm13@fau.edu>; modifications by Russell S. Pierce <rpier001@ucr.edu>
Rosenthal, R., Rosnow, R.L., & Rubin, D.B. (2000). Contrasts and effect sizes in behavioral research: A correlational approach. New York: Cambridge University Press.
Rosenthal, R., Rosnow, R.L., & Rubin, D.B. (2000). Contrasts and correlations in effect-size estimation. Psychological science. 11(6), 446-453.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # To test a single contrast...
tContrast(warpbreaks$breaks,warpbreaks$tension,wgt=c(-1,0,1))
# To test multiple contrasts...
# We make a matrix with our desired contrasts
my.contr <- cbind(
I = c(-1,0,1),
II = c(1,0,-1),
III = c(1,-2,1)
)
# Now we set the contrasts along side the variable
# Now we have to change how.many to match the number
# of contrasts we have
contrasts(warpbreaks[,"tension"],how.many=3) <- my.contr # set the contrasts for the 'group' factor
tContrast(warpbreaks$breaks,warpbreaks$tension)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.