plotres: Plot distribution of standardized residuals

Description Usage Arguments Author(s) Examples

View source: R/plotres.R

Description

Plot empirical (KM) and model-specific cumulative distribution function of standardized residuals

Usage

1
2
3
  plotres(x, var = endogenous(x),
    ylab = "Cumulative Distribution Function",
    xlab = "Standardized residuals", main, k, ...)

Arguments

x

Model, lvmfit object

var

Character vector of (endogenous) variable names

ylab

Label of x-axis

xlab

Label of y-axis

main

Title of plot

k

Optional group number for multiple group analysis

...

Additional argument

Author(s)

Klaus K. Holst

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 

## Simulate data where (y01,y2)
## follows conditional bivariate normal distribution
## given covariate x. Instead of y01 we observe
## right censored version y2
n <- 200
m <- lvm(c(y01,y2) ~ x)
covariance(m) <- y01~y2
set.seed(1)
d <- sim(m,n)
d$cens1 <- rexp(n)
d$status1 <- with(d,y01<cens1)
d$y1 <- with(d, pmin(y01,cens1))

## Estimate model parameters
d$S1 <- with(d, Surv(y1,status1))
m <- lvm(c(S1,y2)~x); covariance(m) <- S1~y2
e <- estimate(m,d,control=list(trace=1))

## Plot cumulative distribution functions
par(mfrow=c(2,2)); plotres(e); plot(e)

## End(Not run)

lava.tobit documentation built on May 2, 2019, 4:58 p.m.