Learn R Programming

eHOF (version 1.6)

plot.HOF: Plot Hierarchical Logistic Regression Models

Description

Plot single or multiple HOF models with or without model parameters.

Usage

## S3 method for class 'HOF':
plot(x, marginal = c('bar', 'rug', 'hist', 'points', 'n'), boxp = TRUE, 
  las.h = 1, yl, main, model, test = 'AICc', modeltypes, onlybest = TRUE, penal, para = 
  FALSE, gam.se = FALSE, color, newdata = NULL, lwd=1, leg = TRUE, add=FALSE, xlabel, ...)
  ## S3 method for class 'HOF.list':
plot(x, plottype = c("layout", "lattice", "all") , xlabel = NULL, 
  test = 'AICc', modeltypes, border.top = 0.1, color, yl, leg = FALSE, ...)

Arguments

encoding

utf8

Details

Plottype layout will give a normal plot for a single species, or if the HOF object contains several species, the graphics display will be divided by autolayout. Multiple species can also be plottet by a 'lattice' xyplot and plotted with plot.HOF for every species. The third option (plottype='all') plots all selected species on the same graph which might be useful to evaluate e.g. the species within one vegetation plot, see examples.

A rug adds a rug representation (1-d plot) of the data to the plot. A rug plot is a compact way of illustrating the marginal distributions of x. Positions of the data points along x and y are denoted by tick marks, reminiscent of the tassels on a rug. Rug marks are overlaid onto the axis. A dit='bar' plot will display the original response values. For binary data this will be identical to rug.

References

de la Cruz Rot M (2005) Improving the Presentation of Results of Logistic Regression with R. Bulletin of the Ecological Society of America 86: 41-48

See Also

HOF

Examples

Run this code
data(acre)
	sel <- c('MATRREC', 'RUMEACT', 'SILENOC', 'APHAARV', 'MYOSARV', 'DESUSOP', 'ARTE#VU')
	mo <- HOF(acre[match(sel, names(acre))], acre.env$PH_KCL, M=1, bootstrap=NULL)
	par(mar=c(2,2,1,.1))
	plot(mo, para=TRUE)

# An example for plottype='all' to show species responses for the species within 
# the most acidic and the most calcareous vegetation plot.
	# acid <- sample(rownames(acre)[acre.env$PH_KCL < 4.8], 1)
	SpeciesFromAnAcidicPlot <- acre['57',] >0
	mods.acidic <- HOF(acre[,SpeciesFromAnAcidicPlot],acre.env$PH_KCL,M=1,bootstrap=NULL)
	SpeciesFromAnCalcareousPlot <- acre[calc <- 
  sample(rownames(acre)[acre.env$PH_KCL > 6], 1),] >0
	mods.calc <- HOF(acre[,SpeciesFromAnCalcareousPlot],acre.env$PH_KCL,M=1,bootstrap=NULL)
	
	autolayout(2)
	plot(mods.acidic, plottype='all', main='Plot with low pH')
	abline(v=acre.env$PH_KCL[acre.env$RELEVE_NR == acid])
	legend('topright',cex=.75, bty='n', lty=1:length(mods.acidic), col= c("black","red",
  "green", "blue", "sienna", "violet")[as.integer(factor(pick.model(mods.acidic)))], 
  names(mods.acidic))
	abline(v=acre.env$PH_KCL[acre.env$RELEVE_NR == acid])
	
	plot(mods.calc, plottype='all', main='Plot with high pH')
	legend('topleft',cex=.75, bty='n', lty=1:length(mods.acidic), col= c("black","red", 
  "green","blue","sienna","violet")[as.integer(factor(pick.model(mods.calc)))], 
  names(mods.calc))
	abline(v=acre.env$PH_KCL[acre.env$RELEVE_NR == calc])

Run the code above in your browser using DataLab