Learn R Programming

simsem (version 0.2-8)

SimDataDist-class: Class "SimDataDist"

Description

This class will provide the distribution of a dataset.

Arguments

Objects from the Class

Objects can be created by simDataDist function. It can also be called from the form new("SimDataDist", ...).

Methods

  • summary
{To summarize the object} run{To create data from an object. There are three additional required objects: n = sample size, m = mean of variables, cm = covariance matrix of variables.} plotDist{To plot a density distribution (for one variable) or a contour plot (for two variables). If the object has more than two variables, the var argument can be used to select the index of plotting variables. For two variables, the default is to have correlation of 0. To change a correlation, the r argument can be used. The xlim and ylim can be specified to set the ranges of variables.} extract{Extract elements from an object. The next argument is the position of the object to be extracted. }

See Also

Examples

Run this code
showClass("SimDataDist")

chisq3 <- simChisq(3)
chisq8 <- simChisq(8)
dist <- simDataDist(chisq3, chisq8)
dist2 <- extract(dist, 2)

m <- c(0, 0)
cm <- matrix(c(1, 0.5, 0.5, 1), 2, 2)
n <- 20
dat <- run(dist, n, m, cm)

plotDist(dist, r=0.2)

Run the code above in your browser using DataLab