Learn R Programming

bild (version 1.2-1)

plot-methods: Methods for Function plot in Package "bild"

Description

Six plots (selectable by which) are currently available: a plot of residuals against fitted values (which=1), a plot of standardized residuals against time (which=2), a plot of the autocorrelation function of the residuals (which=3), a plot of the partial autocorrelation function of the residuals (which=4), a plot for the fitted model (which=5) and a plot for the individual mean profile (which=6). By default, the first five are provided.

Usage

# S4 method for bild,missing
plot(x,which=c(1:5),ylab=NULL,main=NULL, 
    ask=prod(par("mfcol"))

Arguments

x

an object of class bild.

which

if a subset of the plots is required, specify a subset of the numbers 1:6.

ylab

label to some plots (which=5 and 6).

main

title to some plots in addition to the caption (which=5 and 6).

ask

logical expression; if TRUE, the user is asked before each plot.

subSET

logical expression indicating elements to keep in individual mean profile plots: missing values are taken as FALSE. The subSET argument is only for option which=6.

add.unadjusted

logical expression indicating whether or not to add the unadjusted fit for plot in which=5.

ident

logical expression indicating whether or not to add the number of the subject to individual mean profile plots. The ident argument is only for option which=6.

caption

captions to appear above the plots.

cex.caption

controls the size of caption.

Methods

signature(x="ANY", y="ANY"):

Generic function.

signature(x="bild", y="missing"):

Plot diagnostics for bild object.

Details

The option which=5 provides the parametric fitted model if the dependence structure is "ind" (independence), "MC1" (first order Markov Chain) or "MC2" (second order Markov Chain). When the dependence structure is "indR" (independence with random intercept) or "MC1R" (first order Markov Chain with random intercept) or "MC2R" (second order Markov Chain with random intercept) the parametric adjusted fit is provided and the user can set add.unadjusted=TRUE to provide the unadjusted fitted. The option which=6 is used only if the random intercept is present and provides individual mean profile.

Examples

Run this code
# \donttest{ 
## It takes a very long time to run
str(locust)

####  dependence="MC2R"
Integ <- bildIntegrate(li=-2.5,ls=2.5, lig=-2.5, lsg=2.5)   
locust2r_feed1 <- bild(move~(time+I(time^2))*sex, data=locust, 
    subSET=feed=="1", aggregate=sex, dependence="MC2R",  
    integrate=Integ)
    


summary(locust2r_feed1)

plot(locust2r_feed1, which=5, ylab="probability of locomoting",
     add.unadjusted=TRUE)

plot(locust2r_feed1, which=6, subSET=sex=="1", 
    main="sex==1 & Feed=1", ident=TRUE)

locust2r <- bild(move~(time+I(time^2))*feed,data=locust, 
    trace=TRUE, aggregate=feed, dependence="MC2R", 
    integrate=Integ)

par(mfrow=c(2,2))
plot(locust2r, which=1)
plot(locust2r, which=2)
plot(locust2r, which=3)
plot(locust2r, which=4)
par(mfrow=c(1,1))

plot(locust2r, which=5, ylab="probability of locomoting", 
    main="Feed & Unfeed groups", add.unadjusted=TRUE)

plot(locust2r, which=6, ylab="probability of locomoting",
    main="Fed & Unfed groups", ident=TRUE)
# }

Run the code above in your browser using DataLab