Description Usage Arguments Details Value Side Effects ACKNOWLEDGEMENT Author(s) References See Also Examples
View source: R/plot.mixresid.R
Plots the residuals against predictors or fitted values using symbols whose size is proportional to the probability that the associated observation was generated by the associated component of the model.
1 2 3 4 5 
x 
An object of class 
vsFit 
Logical scalar; should the residuals be plotted against the fitted values? 
whichx 
Integer scalar that indicates which predictor to plot against if
there is more than one predictor. I.e. 
digits 
Integer scalar giving the number of digits to which the fitted
values should be rounded when these values are used as axis labels.
Such use occurs only when there are no predictors in the model
(i.e. when the formula is of the form 
shape 
Character string indicating the shape of the plotting symbol; may
be abbreviated, e.g. to 
ngon 
The 
size 
Positive numeric scalar. A scale factor to change the absolute sizes of the plotting symbols; values larger than 1 make the symbols larger; values less than 1 make them smaller. 
gexp 
Nonnegative numeric scalar (“gamma exponent”). The
power to which the conditional “component probabilities”
gamma[i,j] should be raised. The default value
1 causes the area of the plotting symbol to be proportional to the
probability. Setting 
polycol 
Character string specifying the colour in which polygons are plotted.
This encompasses both the colour of the border of the polygon
(specified as 
xlab 
The x label for the plot; defaults to 
... 
Additional arguments (e.g. 
This function is a "method" for plot. The plot produced is visually assessed by ignoring or discounting small symbols.
The label for the xaxis (“xlab
”) is by default
taken from the vnms
component of the object being plotted.
If you find this label to be unsatisfactory, supply the argument
xlab
.
None. This function is called for its side effect of drawing a residual plot.
A residual plot is produced in whatever device is currently open.
The idea of creating residual plots for regression mixtures by making the symbol size proportional to the associated probability is due to Prof. Adrian Baddeley who was, at the time, at the University of Western Australia. He is now (2021) at Curtin University.
Rolf Turner r.turner@auckland.ac.nz
T. Rolf Turner (2000). Estimating the rate of spread of a viral infection of potato plants via mixtures of regressions. Applied Statistics 49 Part 3, pp. 371 – 384.
mixreg()
,
residuals.mixreg()
cband()
,
plot.cband()
,
qqMix()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  thStrt < list(list(beta=c(3.0,0.1),sigsq=16,lambda=0.5),
list(beta=c(0.0,0.0),sigsq=16,lambda=0.5))
fit < mixreg(aphRel,plntsInf,ncomp=2,thetaStart=thStrt,data=aphids)
rrr < residuals(fit)
plot(rrr)
plot(rrr,shape="n")
# The plot with shape="n" gives an impression that variability
# increases with aphRel; the plot with default shape ("disc")
# does not give that impression
rrs < residuals(fit,std=TRUE)
plot(rrs,vsFit=TRUE)
plot(rrs,vsFit=TRUE,shape="n")
fit < mixreg(plntsInf ~ 1,data=aphids,ncomp=2)
rrr < residuals(fit,std=TRUE)
plot(rrr,vsFit=TRUE,digits=4,polycol="blue")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.