Description Usage Arguments Value References See Also Examples
This function calculates mean, variance, skewness, excess kurtosis, and Fleishman coefficients for continuous data and also standardizes each variable.
1 | nctsum(nct.dat)
|
nct.dat |
A data frame consisting of continuous variables. |
A list of length ncol(nct.dat) containing the standardized data and summary statistics for each variable in nct.dat.
Fleishman A.I. (1978). A method for simulating non-normal distributions. Psychometrika, 43(4), 521-532.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | library(PoisBinOrdNonNor)
set.seed(123)
n<-1e4
#first four moments for each simulated variable
moms<-list(c(-1, 1, 0, 1), c(0, 3, 0, 2))
#generate continuous data
cmat.star <- find.cor.mat.star(cor.mat = .8 * diag(2) + .2,
no.nonn = 2,
nonn.list = moms)
nctdata <- genPBONN(n,
no.nonn = length(moms),
cmat.star = cmat.star,
nonn.list = moms)
#set a sample of each variable to missing
nctdata<-apply(nctdata, 2, function(x) {
x[sample(1:n, size=n/10)]<-NA
return(x)
})
nctdata<-data.frame(nctdata)
nctinfo<-nctsum(nctdata)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.