margin.plot.lm: Margin Plots of Response for Pairs of Factors in Linear Model

Usage Arguments Value See Also Examples

Usage

1
2
3
4
## S3 method for class 'lm'
margin.plot(object, reduced, data, factors, lsm, margin,
   error = "full", bar.plot = "lsd",
   xlab, ylab, ...)

Arguments

object

full model object from linear model fit

reduced

reduced model object, for computation of marginal means or effects(default=object)

data

data frame in which to interpret the variables named in the full and reduced objects (determined from reduced fit if omitted)

factors

Character string of length 2 with names of x.factor and trace.factoras found in fit and data (default is first 2 factors in fit).

lsm

Least squares means for plotting (default is fit from full model).

margin

Least squares marginal means for horizontal axis(default is fit from reduced model rounded to proper precision).

error

model to use for error calculation ("full" or "reduced").

bar.plot

error bars:Fisher's LSD ("lsd"=default)or confidence intervals ("ci")or none ("none").

xlab,ylab

plot parameters

...

optional specification of other parameters to be passed to plotting routines.

Value

a plot will be created showing the requested function of responses for each level of the x.factor at each level of the trace.factor. By default, lines for each value of the trace.factor are drawn in different styles so that they may be more easily distinguished.

See Also

lsd.plot, margin.plot, tukey.plot.

Examples

1
2
3
4
5
data(ToothGrowth)
ToothGrowth$dose = ordered(ToothGrowth$dose)
reduced <- lm(len~dose+supp, ToothGrowth)
full <- update(reduced,len~dose*supp)
margin.plot.lm(full,reduced,ToothGrowth)

byandell/pda documentation built on May 13, 2019, 9:27 a.m.