Learn R Programming

walrus (version 1.0.5)

rttestIS: Robust Independent Samples T-Test

Description

Robust Independent Samples T-Test

Usage

rttestIS(
  data,
  deps,
  group,
  yuen = TRUE,
  tr = 0.2,
  mest = FALSE,
  method = "mom",
  yuenbt = FALSE,
  nboot = 599,
  md = FALSE,
  ci = FALSE,
  es = FALSE,
  esci = FALSE
)

Value

A results object containing:

results$ttestthe table of t-test results

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$ttest$asDF

as.data.frame(results$ttest)

Arguments

data

the data as a data frame

deps

a vector of strings naming the dependent variables in data

group

a string naming the grouping variable in data; must have 2 levels

yuen

TRUE (default) or FALSE, use the Yuen's trim method

tr

a number between 0 and 0.5, (default: 0.2), the proportion of measurements to trim from each end, when using the trim and bootstrap methods

mest

TRUE or FALSE (default), use an M-estimator

method

'onestep', 'mom' (default) or 'median', the M-estimator to use; One-step, Modified one-step or Median respectively

yuenbt

TRUE or FALSE (default), use the Yuen's bootstrap method

nboot

a number (default: 599) specifying the number of bootstrap samples to use when using the bootstrap method

md

TRUE or FALSE (default), provide the mean difference

ci

TRUE or FALSE (default), provide a 95% confidence interval on the mean difference

es

TRUE or FALSE (default), provide the effect-size

esci

TRUE or FALSE (default), provide a 95% confidence interval on the effect-size

Examples

Run this code
data('eurosoccer', package='WRS2')

SpainGermany <- subset(eurosoccer, eurosoccer$League == 'Spain' | eurosoccer$League == 'Germany')
SpainGermany <- droplevels(SpainGermany)

rttestIS(SpainGermany,
         dep = 'GoalsScored',
         group = 'League',
         yuen = TRUE,
         mest = TRUE)

#
#  ROBUST INDEPENDENT SAMPLES T-TEST
#
#  Robust Independent Samples T-Test
#  ---------------------------------------------------------
#                                  t         df      p
#  ---------------------------------------------------------
#    GoalsScored    Yuen's test     0.297    17.3    0.770
#                   M-estimator    -0.933            0.993
#  ---------------------------------------------------------
#

Run the code above in your browser using DataLab