R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("mmlcr-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('mmlcr') Loading required package: nnet Loading required package: nlme Loading required package: survival Loading required package: splines > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "BIC.mmlcr" > > ### * BIC.mmlcr > > flush(stderr()); flush(stdout()) > > ### Name: BIC.mmlcr > ### Title: Bayesian Information Criterion > ### Aliases: BIC.mmlcr > ### Keywords: models > > ### ** Examples > > ## Not run: data(mmlcrdf) > ## Not run: > ##D mmlcrdf.mmlcr2 <- mmlcr(outer = ~ sex + cov1 | id, > ##D components = list( > ##D list(formula = resp1 ~ 1, class = "cnormonce", min = 0, max = 50), > ##D list(formula = resp2 ~ poly(age, 2) + tcov1, class = "poislong"), > ##D list(formula = resp3 ~ poly(age, 2), class = "multinomlong") > ##D ), data = mmlcrdf, n.groups = 2) > ## End(Not run) > > ## Not run: BIC(mmlcrdf.mmlcr2) > > > > cleanEx(); ..nameEx <- "Srcdfull" > > ### * Srcdfull > > flush(stderr()); flush(stdout()) > > ### Name: Srcdfull > ### Title: Longitudinal Dataset of Aggression and Reading Ability in > ### Children. > ### Aliases: Srcdfull > ### Keywords: datasets > > ### ** Examples > > data(Srcdfull) > Srcdfull.mmlcr4 <- mmlcr(outer = ~1 | id, components = list( + list(formula = anti ~ poly(age, 2), min = 0, max = 12, + class = "cnormlong"), + list(formula = read ~ poly(age, 2), class = "normlong")), + data = Srcdfull, n.groups = 4) loglike conv. index ll goal Class Percentages: -5090.43 NA NA 24.5 25.3 25.0 25.2 -4968.83 NA NA 21.6 27.0 24.7 26.7 -4719.01 2.05 -5205.77 16.8 28.9 23.8 30.5 -4533.98 0.74 -4005.54 14.9 29.3 22.9 32.9 -4435.60 0.53 -4323.89 14.9 28.5 23.6 33.0 -4354.71 0.82 -3980.62 14.9 26.5 26.3 32.2 -4298.34 0.70 -4168.74 14.9 24.8 29.2 31.0 -4264.08 0.61 -4211.04 15.1 24.0 31.2 29.7 -4241.26 0.67 -4195.73 15.5 23.9 32.2 28.4 -4226.10 0.66 -4196.09 16.0 24.1 32.6 27.3 -4217.61 0.56 -4206.81 16.6 24.4 32.6 26.3 -4213.52 0.48 -4209.70 17.1 24.8 32.5 25.6 -4211.51 0.49 -4209.56 17.6 25.1 32.3 25.0 -4210.41 0.54 -4209.13 18.0 25.5 32.0 24.5 -4209.76 0.60 -4208.76 18.4 25.8 31.8 24.1 -4209.32 0.67 -4208.42 18.7 26.1 31.5 23.8 -4208.99 0.75 -4208.02 18.9 26.4 31.2 23.5 -4208.72 0.83 -4207.44 19.2 26.6 31.0 23.2 -4208.47 0.90 -4206.28 19.4 26.8 30.7 23.0 -4208.24 0.97 -4199.48 19.6 27.1 30.5 22.9 -4207.99 1.05 -4213.21 19.7 27.3 30.3 22.7 -4207.71 1.11 -4210.47 19.9 27.5 30.1 22.6 -4207.40 1.11 -4210.51 20.0 27.6 29.9 22.4 -4207.09 1.01 -4235.72 20.2 27.8 29.7 22.3 -4206.82 0.85 -4205.28 20.3 27.9 29.5 22.2 -4206.63 0.71 -4206.18 20.4 28.0 29.4 22.1 -4206.52 0.60 -4206.35 20.6 28.1 29.2 22.1 -4206.46 0.54 -4206.39 20.7 28.2 29.1 22.0 -4206.43 0.50 -4206.40 20.8 28.3 29.0 22.0 -4206.42 0.44 -4206.41 20.9 28.3 28.9 21.9 -4206.41 0.30 -4206.41 21.0 28.3 28.8 21.9 > > > > cleanEx(); ..nameEx <- "dcnorm" > > ### * dcnorm > > flush(stderr()); flush(stdout()) > > ### Name: dcnorm > ### Title: Density function for Censored Normal Distribution > ### Aliases: dcnorm > ### Keywords: distribution > > ### ** Examples > > > dcnorm(0, mean = 0, sigma = 1) [1] 0.3989423 > > dcnorm(0, mean = 0, sigma = 1, min = 0) [1] 0.5 > > > > cleanEx(); ..nameEx <- "mmlcr" > > ### * mmlcr > > flush(stderr()); flush(stdout()) > > ### Name: mmlcr > ### Title: Mixed Mode Latent Class Regression > ### Aliases: mmlcr mmlcr.default mmlcr.mmlcr anova.mmlcr formula.mmlcr > ### logLik.mmlcr print.mmlcr print.summary.mmlcr summary.mmlcr vcov.mmlcr > ### Keywords: models > > ### ** Examples > > data(mmlcrdf) > > mmlcrdf.mmlcr2 <- mmlcr(outer = ~ sex + cov1 | id, + components = list( + list(formula = resp1 ~ 1, class = "cnormonce", min = 0, max = 50), + list(formula = resp2 ~ poly(age, 2) + tcov1, class = "poislong"), + list(formula = resp3 ~ poly(age, 2), class = "multinomlong") + ), data = mmlcrdf, n.groups = 2) loglike conv. index ll goal Class Percentages: -3602.71 NA NA 44.9 55.1 -2805.44 NA NA 38.0 62.0 -2766.26 0.05 -2764.23 35.1 64.9 -2758.67 0.19 -2756.85 33.3 66.7 -2756.53 0.28 -2755.69 32.1 67.9 -2755.55 0.46 -2754.74 31.1 68.9 -2754.26 1.33 -2759.49 30.1 69.9 -2752.67 1.22 -2761.41 29.1 70.9 -2751.17 0.95 -2723.77 28.2 71.8 -2749.63 1.02 -2815.38 27.4 72.6 -2748.33 0.85 -2740.86 26.8 73.2 -2747.59 0.57 -2746.62 26.2 73.8 -2747.13 0.61 -2746.41 25.8 74.2 -2746.78 0.77 -2745.63 25.5 74.5 -2746.51 0.77 -2745.63 25.2 74.8 -2746.33 0.68 -2745.93 25.1 74.9 -2746.22 0.60 -2746.06 24.9 75.1 -2746.16 0.55 -2746.09 24.8 75.2 -2746.13 0.51 -2746.10 24.7 75.3 -2746.11 0.53 -2746.10 24.7 75.3 -2746.11 0.46 -2746.10 24.6 75.4 -2746.10 0.46 -2746.10 24.6 75.4 > > mmlcrdf.mmlcr2.inter <- mmlcr(outer = ~ sex * cov1 | id, + components = list( + list(formula = resp1 ~ 1, class = "cnormonce", min = 0, max = 50), + list(formula = resp2 ~ poly(age, 2) + tcov1, class = "poislong"), + list(formula = resp3 ~ poly(age, 2), class = "multinomlong") + ), data = mmlcrdf, n.groups = 2, + post.prob = mmlcrdf.mmlcr2$post.prob, no.fit = TRUE) > > mmlcrdf.mmlcr2.inter <- mmlcr(mmlcrdf.mmlcr2.inter) loglike conv. index ll goal Class Percentages: -2748.22 NA NA 25.8 74.2 -2746.76 NA NA 25.5 74.5 -2746.47 0.20 -2746.39 25.3 74.7 -2746.32 0.51 -2746.16 25.1 74.9 -2746.23 0.63 -2746.07 24.9 75.1 -2746.17 0.60 -2746.09 24.8 75.2 -2746.14 0.57 -2746.10 24.8 75.2 -2746.12 0.58 -2746.09 24.7 75.3 -2746.11 0.52 -2746.10 24.7 75.3 -2746.10 0.53 -2746.10 24.7 75.3 -2746.10 0.55 -2746.10 24.6 75.4 > > > > cleanEx(); ..nameEx <- "mmlcrclassify" > > ### * mmlcrclassify > > flush(stderr()); flush(stdout()) > > ### Name: mmlcrclassify > ### Title: Classification of Individuals by Modal Posterior Probabilities > ### Aliases: mmlcrclassify > ### Keywords: models > > ### ** Examples > > ## Not run: > ##D data(mmlcrdf) > ##D > ##D mmlcrdf.mmlcr2 <- mmlcr(outer = ~ sex + cov1 | id, > ##D components = list( > ##D list(formula = resp1 ~ 1, class = "cnormonce", min = 0, max = 50), > ##D list(formula = resp2 ~ poly(age, 2) + tcov1, class = "poislong"), > ##D list(formula = resp3 ~ poly(age, 2), class = "multinomlong") > ##D ), data = mmlcrdf, n.groups = 2) > ##D > ##D mmlcrclassify(mmlcrdf.mmlcr2) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "mmlcrdf" > > ### * mmlcrdf > > flush(stderr()); flush(stdout()) > > ### Name: mmlcrdf > ### Title: An artificial data frame for `mmlcr' examples. > ### Aliases: mmlcrdf > ### Keywords: datasets > > ### ** Examples > > ## Not run: data(mmlcrdf) > ## Not run: > ##D mmlcrdf.mmlcr2 <- mmlcr(outer = ~ sex + cov1 | id, > ##D components = list( > ##D list(formula = resp1 ~ 1, class = "cnormonce", min = 0, max = 50), > ##D list(formula = resp2 ~ poly(age, 2) + tcov1, class = "poislong"), > ##D list(formula = resp3 ~ poly(age, 2), class = "multinomlong") > ##D ), data = mmlcrdf, n.groups = 2) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "postprob" > > ### * postprob > > flush(stderr()); flush(stdout()) > > ### Name: postprob > ### Title: Extract Posterior Probabilities from mmlcr Object > ### Aliases: postprob > ### Keywords: models > > ### ** Examples > > ## Not run: > ##D data(mmlcrdf) > ##D > ##D mmlcrdf.mmlcr2 <- mmlcr(outer = ~ sex + cov1 | id, > ##D components = list( > ##D list(formula = resp1 ~ 1, class = "cnormonce", min = 0, max = 50), > ##D list(formula = resp2 ~ poly(age, 2) + tcov1, class = "poislong"), > ##D list(formula = resp3 ~ poly(age, 2), class = "multinomlong") > ##D ), data = mmlcrdf, n.groups = 2) > ##D > ##D postprob(mmlcrdf.mmlcr2) > ##D > ## End(Not run) > > > ### *