Description Usage Arguments Details Value Objects from the Class Author(s) See Also Examples
A common class for representing data. No matter the actual representation of data, the important characteristics are contained in a graphical metadata object.
1 2 3 4 5 6 7 8 9 | newgmData(varNames,
varTypes=rep(validVarTypes()[1],length(varNames)),
nLevels=NULL,
latent=NULL,
valueLabels=NULL,
observations=NULL,
description=NULL,
shortNames=NULL
)
|
varNames |
a vector of strings with names of variables. |
varTypes |
a vector of strings with values from
|
nLevels |
a numeric vector with integer values for discrete or ordinal variables giving the number of levels. |
latent |
a vector of strings with names of the latent variables. |
valueLabels |
a list of vectors of strings with names of the levels for each discrete or ordinal variable. |
observations |
an object containing the observations, eg. a dataframe or a table. |
description |
a string describing the origin of the data. |
shortNames |
a vector of strings giving a short name of each variable. |
If neither nLevels nor valueLabels are given, then all categorical variables are assumed to be binary. If valueLabels are given then nLevels are infered from these. valueLabels / nLevels are recycled if necessary.
An object of class gmData
holds information about the data
and can be retrieved and changed by accessor functions.
Objects can be created by calls of the form
newgmData(
varNames, varTypes, nLevels, latent, valueLabels,
observations, description)
.
More often, gmData objects will be created from a data.frame or table.
A gmData
object contains the abstraction of data into a
meta data object including variable names and types etc. However, the
actual data might not be present or may be represented by a reference
to data, such as a database file. Also, it may be possible to work
without data, which may be valuable if the point of interest is in the
model alone. Separating the specification of the
variables from data has the benefit, that some properties of a model can be
investigated without any reference to data, for example
decomposability and collapsibility.
S<f8>ren H<f8>jsgaard, sorenh@math.aau.dk,
Claus Dethlefsen, dethlef@math.aau.dk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | vn <- c("a","b","c","d")
z<-newgmData(vn,varTypes=c("dis","dis","con","con"))
summary(z)
z<-newgmData(vn,varTypes=c("dis","dis","con","con"),nLevels=c(4,3,NA,NA))
summary(z)
z<-newgmData(vn,varTypes=c("dis","dis","con","con"),nLevels=c(4,NA,NA,NA))
summary(z)
z<-newgmData(vn,varTypes=c("dis","dis","ord","con"),valueLabels=list("a"=1:2, "b"=1:4))
summary(z)
ccnames <- c("asia", "smoke", "tub", "lung", "bronc", "either", "xray", "dysp")
gmd <- newgmData(ccnames,valueLabels=c("yes","no"), description="Chest clinic")
summary(gmd)
data(mathmark)
as.gmData(mathmark)
data(HairEyeColor)
as.gmData(HairEyeColor)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.