# paired_test_continuous: Paired test for continuous variables In CorradoLanera/depigner: Utilities for _pigna_ stuffs at UBESP

## Description

Statistical tests for paired continuous variable.

## Usage

 `1` ```paired_test_continuous(group, x) ```

## Arguments

 `group` (fct) vector of groups `x` (num) vector of observations. Note: lenght of 'x' is considered equal to the number of subjects by the number of groups. Observation must be provided by subject (e.g. c(a1, b1, c1, a2, b2, c2, a3, b3, c3, a4, b4, c4), where the letters, a, b, c, and d represents the groups and the numbers represents the patien's ids). Note only patient with observation in all the levels considered will be used.

## Details

If the test is requested for two paired groups, the `t.test` is used.

If the test is requested for more than two groups, the test based on ANOVA for repeated measures is used (powered by `aov`)

## Value

A list with components 'P' (the computed P-value), 'stat' (the test statistic, either t or F), 'df' (degrees of freedom), 'testname' (test name), 'statname' (statistic name), 'namefun' ("paired_tstat", "rep_aov"), 'latexstat' (LaTeX representation of statname), 'plotmathstat' (for R - the plotmath representation of 'statname', as a character string), 'note' (contains a character string note about the test).

## Note

This function could be used as 'conTest' option in the `summary.formula` with method 'reverse'.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26``` ``` library(Hmisc) ## two groups summary(Species ~., data = iris[iris\$Species != "setosa",], method = "reverse", test = TRUE, conTest = paired_test_continuous ) ## more than two groups summary(Species ~., data = iris, method = "reverse", test = TRUE, conTest = paired_test_continuous ) ## without Hmisc two_obs <- iris\$Sepal.Length[iris\$Species != "setosa"] two_groups <- iris\$Species[iris\$Species != "setosa"] paired_test_continuous(two_groups, two_obs) obs <- iris\$Sepal.Length many_groups <- iris\$Species paired_test_continuous(many_groups, obs) ```

CorradoLanera/depigner documentation built on June 1, 2019, 9:12 p.m.