#' @keywords internal
"_PACKAGE"

##' Estimation and simulation of latent variable models
##'
##' A general implementation of Structural Equation Models wth latent variables
##' (MLE, 2SLS, and composite likelihood estimators) with both continuous,
##' censored, and ordinal outcomes (Holst and Budtz-Joergensen (2013)
##' <doi:10.1007/s00180-012-0344-y>). Mixture latent variable models and
##' non-linear latent variable models (Holst and Budtz-Joergensen (2020)
##' <doi:10.1093/biostatistics/kxy082>). The package also provides methods for
##' graph exploration (d-separation, back-door criterion), simulation of general
##' non-linear latent variable models, and estimation of influence functions for
##' a broad range of statistical models.
##' @name lava-package
##' @importFrom graphics plot lines points abline points text layout par plot.new plot.window title rect locator segments image mtext box axis polygon matplot contour contour.default identify rug curve
##' @importFrom grDevices xy.coords col2rgb rgb colors rainbow topo.colors gray.colors palette colorRampPalette heat.colors
##' @importFrom utils stack combn read.csv getTxtProgressBar setTxtProgressBar txtProgressBar head tail modifyList getFromNamespace write.table methods data glob2rx
##' @importFrom stats density deriv effects lm family simulate vcov var cov cor coef model.frame model.weights as.formula model.matrix rnorm rchisq runif rlnorm pnorm qnorm na.omit AIC terms logLik qt pt update update.formula confint approxfun pchisq confint.default formula fft uniroot rbinom predict sd addmargins residuals dnorm quantile qf cov2cor qchisq get_all_vars p.adjust rpois rt rmultinom rgamma printCoefmat glm nlminb na.pass na.omit influence weights density.default
##' @importFrom survival is.Surv
##' @importFrom future.apply future_mapply future_lapply
##' @importFrom methods new as
##' @aliases lava-package lava
##' @author Klaus K. Holst Maintainer: <klaus@@holst.it>
##' @keywords package
##' @examples
##' lava()
NULL

##' Longitudinal Bone Mineral Density Data
##'
##' Bone Mineral Density Data consisting of 112 girls randomized to receive
##' calcium og placebo. Longitudinal measurements of bone mineral density
##' (g/cm^2) measured approximately every 6th month in 3 years.
##' @name calcium
##' @docType data
##' @format A data.frame containing 560 (incomplete) observations. The 'person'
##' column defines the individual girls of the study with measurements at
##' visiting times 'visit', and age in years 'age' at the time of visit. The
##' bone mineral density variable is 'bmd' (g/cm^2).
##' @source Vonesh & Chinchilli (1997), Table 5.4.1 on page 228.
##' @keywords datasets
NULL

##' Longitudinal Bone Mineral Density Data (Wide format)
##'
##' Bone Mineral Density Data consisting of 112 girls randomized to receive
##' calcium og placebo. Longitudinal measurements of bone mineral density
##' (g/cm^2) measured approximately every 6th month in 3 years.
##' @name bmd
##' @docType data
##' @source Vonesh & Chinchilli (1997), Table 5.4.1 on page 228.
##' @format data.frame
##' @keywords datasets
##' @seealso calcium
NULL

##' Simulated data
##'
##' Simulated data
##' @name brisa
##' @docType data
##' @format data.frame
##' @source Simulated
##' @keywords datasets
NULL

##' Data
##'
##' Description
##' @name bmidata
##' @docType data
##' @format data.frame
##' @keywords datasets
NULL

##' 50 patients from Monash Medical Centre, Melbourne
##'
##' Diagnosis of depression (DSM-III-R MDD, Dysthymia, Adjustment Disorder with
##' Depressed Mood, Depression NOS), Beck Depression Inventory (BDI) (Beck et
##' al., 1961) General Health Questionnaire (GHQ) (Goldberg & Williams, 1988)
##'
##' @name deprdiag
##' @docType data
##' @format data.frame
##' @source Clarke, D. M., Smith, G. C., & Herrman, H. E. (1993). A comparative
##'   study of screening instruments for mental disorders in general hospital
##'   patients. International Journal Psychiatry in Medicine, 23, pp. 323-337.
##'
##' McKenzie et al. (1996). Comparing correlated Kappas by resampling: Is one
##' level of agreement significantly different from another? J. Psychiat. Res.
##' 30 (6), pp. 483-492.
##' @keywords datasets
NULL

##' Hubble data
##'
##' Velocity (v) and distance (D) measures of 36 Type Ia super-novae from the
##' Hubble Space Telescope
##' @name hubble
##' @docType data
##' @format data.frame
##' @source Freedman, W. L., et al. 2001, AstroPhysicalJournal, 553, 47.
##' @keywords datasets
NULL

##' Hubble data
##'
##' @name hubble2
##' @seealso hubble
##' @docType data
##' @format data.frame
##' @keywords datasets
NULL

##' Data
##'
##' Description
##' @name indoorenv
##' @docType data
##' @format data.frame
##' @source Simulated
##' @keywords datasets
NULL

##' Missing data example
##'
##' Simulated data generated from model
##' \deqn{E(Y_i\mid X) = X, \quad cov(Y_1,Y_2\mid X)=0.5}
##'
##' The list contains four data sets
##' 1) Complete data
##' 2) MCAR
##' 3) MAR
##' 4) MNAR (missing mechanism depends on variable V correlated with Y1,Y2)
##' @examples
##' data(missingdata)
##' e0 <- estimate(lvm(c(y1,y2)~b*x,y1~~y2),missingdata[[1]]) ## No missing
##' e1 <- estimate(lvm(c(y1,y2)~b*x,y1~~y2),missingdata[[2]]) ## CC (MCAR)
##' e2 <- estimate(lvm(c(y1,y2)~b*x,y1~~y2),missingdata[[2]],missing=TRUE) ## MCAR
##' e3 <- estimate(lvm(c(y1,y2)~b*x,y1~~y2),missingdata[[3]]) ## CC (MAR)
##' e4 <- estimate(lvm(c(y1,y2)~b*x,y1~~y2),missingdata[[3]],missing=TRUE) ## MAR
##' @name missingdata
##' @docType data
##' @format list of data.frames
##' @source Simulated
##' @keywords datasets
NULL

##' Example data (nonlinear model)
##'
##' @name nldata
##' @docType data
##' @format data.frame
##' @source Simulated
##' @keywords datasets
NULL

##' Example SEM data (nonlinear)
##'
##' Simulated data
##' @name nsem
##' @docType data
##' @format data.frame
##' @source Simulated
##' @keywords datasets
NULL

##' Example SEM data
##'
##' Simulated data
##' @name semdata
##' @docType data
##' @source Simulated
##' @format data.frame
##' @keywords datasets
NULL

##' Serotonin data
##'
##' This simulated data mimics a PET imaging study where the 5-HT2A
##' receptor and serotonin transporter (SERT) binding potential has
##' been quantified into 8 different regions. The 5-HT2A
##' cortical regions are considered high-binding regions
## 'which are a priori known to yield quite similar and highly correlated
##' measurements.  These measurements can be regarded as proxy measures of
##' the extra-cellular levels of serotonin in the brain
##' \tabular{rll}{
##'         day    \tab numeric \tab Scan day of the year \cr
##'         age    \tab numeric \tab Age at baseline scan \cr
##'         mem    \tab numeric \tab Memory performance score \cr
##'         depr   \tab numeric \tab Depression (mild) status 500 days after baseline \cr
##'         gene1  \tab numeric \tab Gene marker 1 (HTR2A) \cr
##'         gene2  \tab numeric \tab Gene marker 2 (HTTTLPR) \cr
##'         cau \tab numeric \tab SERT binding, Caudate Nucleus \cr
##'         th  \tab numeric \tab SERT binding, Thalamus \cr
##'         put \tab numeric \tab SERT binding, Putamen \cr
##'         mid \tab numeric \tab SERT binding, Midbrain \cr
##'         aci \tab numeric \tab 5-HT2A binding, Anterior cingulate gyrus \cr
##'         pci  \tab numeric \tab 5-HT2A binding, Posterior cingulate gyrus \cr
##'         sfc \tab numeric \tab 5-HT2A binding, Superior frontal cortex \cr
##'         par \tab numeric \tab 5-HT2A binding, Parietal cortex \cr
##' }
##' @name serotonin
##' @docType data
##' @format data.frame
##' @source Simulated
##' @keywords datasets
NULL

##' Twin menarche data
##'
##' Simulated data
##' \tabular{rll}{
##'         id    \tab numeric \tab Twin-pair id \cr
##'         zyg    \tab character \tab Zygosity (MZ or DZ) \cr
##'         twinnum    \tab numeric \tab Twin number (1 or 2) \cr
##'         agemena    \tab numeric \tab Age at menarche (or censoring) \cr
##'         status    \tab logical \tab Censoring status (observed:=T,censored:=F) \cr
##'         bw    \tab numeric  \tab Birth weight \cr
##'         msmoke    \tab numeric \tab Did mother smoke? (yes:=1,no:=0) \cr
##' }
##' @name twindata
##' @docType data
##' @format data.frame
##' @keywords datasets
##' @source Simulated
NULL

##' For internal use
##'
##' @title For internal use
##' @name startvalues
##' @author Klaus K. Holst
##' @keywords internal
##' @rdname internal
##' @export
##' @aliases startvalues startvalues0 startvalues1 startvalues2
##' @aliases starter.multigroup
##' @aliases modelPar modelVar matrices pars pars.lvm regfix
##' @aliases pars.lvmfit pars.glm score.glm procdata.lvmfit mat.lvm
##' @aliases matrices reorderdata graph2lvm igraph.lvm subgraph finalize
##' @aliases randomslope randomslope<- lisrel
##' @aliases variances offdiags describecoef parlabels rsq stdcoef CoefMat
##' @aliases CoefMat.multigroupfit deriv updatelvm checkmultigroup profci
##' @aliases estimate.MAR
##' @aliases missingModel Identical gaussian_logLik.lvm
##' @aliases addhook gethook multigroup
##' @aliases Weights fixsome IV parameter Specials
##' @aliases procformula getoutcome decomp.specials
##' @aliases rmvn0 dmvn0 logit expit tigol
NULL
