tableToData {ltable} | R Documentation |
Constructs data.frames that fit glm or PowerPoisson modelling out of tables created with function table_f.
tableToData(tname, numerictype="", orderedtype="")
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 |
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. Good practice is to have data without zero counts. In the Poisson GLM, the mean and variance are the same thing. The implication of this 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.
returns object of class data.frame
Ocheredko Oleksandr Ocheredko@yahoo.com
require(ltable) data(sdata, package="ltable") stab<-table_f(sdata, "a,b,c") sdat<-tableToData(stab, orderedtype="c") res<-PowerPoisson(Counts~a+b+c+a*c, effect="a*c", data=sdat) plot(res, st=3)