Learn R Programming

stats4teaching (version 0.1.0)

pairedm: Paired measures (T-Test & Regression)

Description

Generates two paired measures. It provides T-test and a simple linear regression model for generated data.

Usage

pairedm(n, mean = 0, sigma = 1, coefvar = NULL,
        rho = NULL, alternative = c("two.sided", "less", "greater"),
        delta = 0, conf.level = 0.95, dec = 2,
        random = FALSE)

Value

List containing the following components :

  • Data: a data frame containing the samples created.

  • Model: linear regression model.

  • T.Test: a t-test for the samples.

Arguments

n

size of each sample.

mean

vector of means.

sigma

vector of standard deviations.

coefvar

an optional vector of coefficients of variation.

rho

Pearson correlation coefficient (optional). If rho = NULL a random covariance matrix is generated by genPositiveDefMat().

alternative

a character string specifying the alternative hypothesis for T-Test. Must be one of ``two.sided`` (default), ``greater`` or ``less``. Can be specified just the initial letter.

delta

true value of the difference in means.

conf.level

confidence level for interval in T-Test.

dec

number of decimals for observations.

random

a logical a logical indicating whether you want a random covariance/variance matrix.

Details

If random = TRUE, rho is omitted and sigma is taken as range for variances of the covariance matrix.

See Also

[clusterGeneration::genpositiveDefMat()]

Examples

Run this code

pairedm(10, mean = c(10,2), sigma = c(1.2,0.7), rho = 0.5, alternative = "g")
pairedm(15, mean =c(1,2), coefvar = 0.1, random = TRUE)

Run the code above in your browser using DataLab