File: gof.Rd

package info (click to toggle)
r-cran-lava 1.8.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,816 kB
  • sloc: sh: 13; makefile: 2
file content (104 lines) | stat: -rw-r--r-- 2,843 bytes parent folder | download | duplicates (4)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gof.R
\name{gof}
\alias{gof}
\alias{gof.lvmfit}
\alias{moments}
\alias{moments.lvm}
\alias{information}
\alias{information.lvmfit}
\alias{score}
\alias{score.lvmfit}
\alias{logLik.lvmfit}
\title{Extract model summaries and GOF statistics for model object}
\usage{
gof(object, ...)

\method{gof}{lvmfit}(object, chisq=FALSE, level=0.90, rmsea.threshold=0.05,all=FALSE,...)

moments(x,...)

\method{moments}{lvm}(x, p, debug=FALSE, conditional=FALSE, data=NULL, latent=FALSE, ...)

\method{logLik}{lvmfit}(object, p=coef(object),
                      data=model.frame(object),
                      model=object$estimator,
                      weights=Weights(object),
                      data2=object$data$data2,
                          ...)

\method{score}{lvmfit}(x, data=model.frame(x), p=pars(x), model=x$estimator,
                   weights=Weights(x), data2=x$data$data2, ...)

\method{information}{lvmfit}(x,p=pars(x),n=x$data$n,data=model.frame(x),
                   model=x$estimator,weights=Weights(x), data2=x$data$data2, ...)
}
\arguments{
\item{object}{Model object}

\item{\dots}{Additional arguments to be passed to the low level functions}

\item{x}{Model object}

\item{p}{Parameter vector used to calculate statistics}

\item{data}{Data.frame to use}

\item{latent}{If TRUE predictions of latent variables are included in output}

\item{data2}{Optional second data.frame (only for censored observations)}

\item{weights}{Optional weight matrix}

\item{n}{Number of observations}

\item{conditional}{If TRUE the conditional moments given the covariates are
calculated. Otherwise the joint moments are calculated}

\item{model}{String defining estimator, e.g. "gaussian" (see
\code{estimate})}

\item{debug}{Debugging only}

\item{chisq}{Boolean indicating whether to calculate chi-squared
goodness-of-fit (always TRUE for estimator='gaussian')}

\item{level}{Level of confidence limits for RMSEA}

\item{rmsea.threshold}{Which probability to calculate, Pr(RMSEA<rmsea.treshold)}

\item{all}{Calculate all (ad hoc) FIT indices: TLI, CFI, NFI, SRMR, ...}
}
\value{
A \code{htest}-object.
}
\description{
Calculates various GOF statistics for model object including global
chi-squared test statistic and AIC. Extract model-specific mean and variance
structure, residuals and various predicitions.
}
\examples{
m <- lvm(list(y~v1+v2+v3+v4,c(v1,v2,v3,v4)~x))
set.seed(1)
dd <- sim(m,1000)
e <- estimate(m, dd)
gof(e,all=TRUE,rmsea.threshold=0.05,level=0.9)


set.seed(1)
m <- lvm(list(c(y1,y2,y3)~u,y1~x)); latent(m) <- ~u
regression(m,c(y2,y3)~u) <- "b"
d <- sim(m,1000)
e <- estimate(m,d)
rsq(e)
##'
rr <- rsq(e,TRUE)
rr
estimate(rr,contrast=rbind(c(1,-1,0),c(1,0,-1),c(0,1,-1)))

}
\author{
Klaus K. Holst
}
\keyword{methods}
\keyword{models}