descriptives.trait: Function to generate descriptive summary tables for...

Description Usage Arguments Value Author(s) Examples

View source: R/descriptives.trait.R

Description

Function to generate descriptive summary tables for phenotypic data

Usage

1
	descriptives.trait(data,subset,file,by.var=NULL,digits = 3)

Arguments

data

an object of snp.data-class or gwaa.data-class

subset

Subset of people to run analysis on. If missing, all people from data are used for analysis.

file

A string specifying the name of a file to write the tables to (default is no file otput).

by.var

a binary variable or a character scalar specifying the name of a binary trait in data; statistics will be produced separately for the groups and compared

digits

number of digits to be printed

Value

A table with descriptive statistics. Ptt: t-test; Pkw: kruskal.test; Pex: Fisher exact test (for factors with <5 levels)

Author(s)

Yurii Aulchenko

Examples

1
2
3
4
5
6
7
8
	require(GenABEL.data)
	data(srdta)
	descriptives.trait(srdta)
	descriptives.trait(srdta,by.var=srdta@phdata$sex)
	descriptives.trait(srdta,by.var="sex")
	attach(phdata(srdta))
	descriptives.trait(srdta,by.var=sex)
	detach(phdata(srdta))

Example output

Loading required package: MASS
Loading required package: GenABEL.data
      No   Mean     SD
id  2500     NA     NA
sex 2500  0.510  0.500
age 2500 50.038  7.060
qt1 2497 -0.298  1.001
qt2 2500  6.122 30.601
qt3 2489  2.609  1.101
bt  2489  0.500  0.500
    No(by.var=0)   Mean     SD No(by.var=1)   Mean     SD   Ptt   Pkw Pexact
id          1225     NA     NA         1275     NA     NA    NA    NA     NA
sex         1225     NA     NA         1275     NA     NA    NA    NA     NA
age         1225 49.947  7.080         1275 50.125  7.043 0.528 0.574     NA
qt1         1224 -0.271  0.992         1273 -0.325  1.009 0.179 0.112     NA
qt2         1225  5.445 25.267         1275  6.773 34.965 0.275 0.000     NA
qt3         1221  2.494  1.091         1268  2.719  1.100 0.000 0.000     NA
bt          1221  0.454  0.498         1268  0.544  0.498 0.000 0.000      0
    No(by.var=0)   Mean     SD No(by.var=1)   Mean     SD   Ptt   Pkw Pexact
id          1225     NA     NA         1275     NA     NA    NA    NA     NA
sex         1225     NA     NA         1275     NA     NA    NA    NA     NA
age         1225 49.947  7.080         1275 50.125  7.043 0.528 0.574     NA
qt1         1224 -0.271  0.992         1273 -0.325  1.009 0.179 0.112     NA
qt2         1225  5.445 25.267         1275  6.773 34.965 0.275 0.000     NA
qt3         1221  2.494  1.091         1268  2.719  1.100 0.000 0.000     NA
bt          1221  0.454  0.498         1268  0.544  0.498 0.000 0.000      0
    No(by.var=0)   Mean     SD No(by.var=1)   Mean     SD   Ptt   Pkw Pexact
id          1225     NA     NA         1275     NA     NA    NA    NA     NA
sex         1225     NA     NA         1275     NA     NA    NA    NA     NA
age         1225 49.947  7.080         1275 50.125  7.043 0.528 0.574     NA
qt1         1224 -0.271  0.992         1273 -0.325  1.009 0.179 0.112     NA
qt2         1225  5.445 25.267         1275  6.773 34.965 0.275 0.000     NA
qt3         1221  2.494  1.091         1268  2.719  1.100 0.000 0.000     NA
bt          1221  0.454  0.498         1268  0.544  0.498 0.000 0.000      0

GenABEL documentation built on May 30, 2017, 3:36 a.m.