Description Usage Arguments Value Author(s) Examples

Perform a one-sample t test, a paired-sample t test or an independent-samples t test on variables of a data set. The output is printed as a LaTeX table that mimics the look of SPSS output (version <24).

1 2 3 4 |

`data` |
a data frame containing the variables. |

`variables` |
a character vector specifying numeric variable(s) to be
used for testing the mean(s). If |

`group` |
a character string specifying a grouping variable for an
independent-samples t-test, or |

`mu` |
a number indicating the true value of the mean for a one-sample t test. |

`conf.level` |
a number between 0 and 1 giving the confidence level of the confidence interval. |

`x` |
an object of class |

`digits` |
an integer giving the number of digits after the comma to be printed in the LaTeX tables. |

`statistics` |
a character vector specifying which LaTeX tables should
be printed. Available options are |

`...` |
currently ignored. |

An object of class `"tTestSPSS"`

with the following
components:

`statistics`

a data frame containing the relevant descriptive statistics.

`test`

an object of class

`"htest"`

as returned by`t.test`

(only one-sample and paired-sample tests).`variables`

a character vector containing the name(s) of the relevant numeric variable(s).

`n`

an integer giving the number of observations (only paired-sample test).

`levene`

an object as returned by

`leveneTest`

(only independent-samples test).`pooled`

an object of class

`"htest"`

as returned by`t.test`

assuming equal variances (only independent-samples test).`satterthwaite`

an object of class

`"htest"`

as returned by`t.test`

not assuming equal variance (only independent-samples test).`group`

a character string containing the name of the grouping variable (only independent-samples test).

`type`

a character string giving the type of t test performed (

`"one-sample"`

,`"paired"`

, or`"independent"`

).

The `print`

method produces a LaTeX table that mimics the look of SPSS
output (version <24).

Andreas Alfons

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ```
## one-sample and paired-sample t test
# load data
data("Exams")
# test whether the average grade on the resit
# differs from 5.5 (minimum passing grade)
tTest(Exams, "Resit", mu = 5.5)
# test whether average grades differ between the
# regular exam and the resit
tTest(Exams, c("Resit", "Regular"))
## independent-samples t test
# load data
data("Eredivisie")
# log-transform market values
Eredivisie$logMarketValue <- log(Eredivisie$MarketValue)
# test whether average log market values differ between
# Dutch and foreign players
tTest(Eredivisie, "logMarketValue", group = "Foreign")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.