Last data update: 2014.03.03

R: Paired Sample t-test
onesampR Documentation

Paired Sample t-test

Description

This function performs a t-test for the mean difference for paired data, and produces a scatterplot of one column against the other column, showing whether there was any benefit to using the paired design.

Usage

onesamp(dset, x="unsprayed", y="sprayed", xlab=NULL, ylab=NULL,
        dubious=NULL, conv=NULL, dig=2)

Arguments

dset

a matrix or dataframe having two columns

x

name of column to play the role of the ‘predictor’

y

name of column to play the role of the ‘response’

xlab

horizontal axis label

ylab

vertical axis label

dubious

vector of logical (FALSE/TRUE) values, specifying points that are to be omitted

conv

scaling factor that should be applied to data

dig

round SE to this number of digits for dispplay on graph

Value

A scatterplot of y against x together with estimates of standard errors and standard errors of the difference (y-x).

Also produced is a confidence interval and p-value for the test.

Author(s)

J.H. Maindonald

Examples

onesamp(dset = pair65, x = "ambient", y = "heated", xlab =
        "Amount of stretch (ambient)", ylab =
        "Amount of stretch (heated)") 

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DAAG)
Loading required package: lattice
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DAAG/onesamp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: onesamp
> ### Title: Paired Sample t-test
> ### Aliases: onesamp
> ### Keywords: models
> 
> ### ** Examples
> 
> onesamp(dset = pair65, x = "ambient", y = "heated", xlab =
+         "Amount of stretch (ambient)", ylab =
+         "Amount of stretch (heated)") 

 heated 14.60403 16.28479 6.103278 

	One Sample t-test

data:  d
t = 3.1131, df = 8, p-value = 0.01438
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
  1.641939 11.024728
sample estimates:
mean of x 
 6.333333 

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>