tableToData: Function _tableToData_

View source: R/tableToData.R

tableToDataR Documentation

Function tableToData

Description

Constructs data.frames that fit glm{stats} or MCLogLin{ltable}, MCPower{ltable} modelling out of tables created with function table_f{ltable}.

Usage

tableToData(tname, numerictype="", orderedtype="")

Arguments

tname

name of the tables created with function table_f; object of data.frame class

numerictype

the character string that lists variable names separated by comma to be transformed to numeric class. Variable "Counts" shouldn't be listed

orderedtype

the character string that lists variable names separated by comma to be transformed to ordered factor class. Variable "Counts" shouldn't be listed

Details

  • Variables of character and logical classes shape the same design as does the factor class, therefore there is no need to change them to factors.

  • Check the input and output. It's not a problem to have huge counts together with zero counts for NB2 model used in ltable. Still good practice to proceed with power analisis is to have data without zero counts. It's in no way detrimental as in the case of the Poisson GLM, having the mean and variance equality. The implication with Poisson GLM is that as the mean tends to zero, so must the variance. Still we do have some uncertainty about this fitted value. Of the same nature (but converse) problem is with cells of large counts.

  • You can build the data by hand and skip this functionality.

Value

returns object of class data.frame

Author(s)

Ocheredko Oleksandr Ocheredko@yahoo.com

See Also

reshape

Examples

require(ltable)
data(iris)
iriscut<-with(iris, data.frame(PL=cut(Petal.Length,3),
                               PW=cut(Petal.Width,3)))
irist<-table_f(iriscut,"PL,PW")
irisd<-tableToData(irist, ordered="PL,PW")


ltable documentation built on Aug. 17, 2023, 1:06 a.m.