Performs approximate conditional inference on a scalar parameter of
interest in regression-scale models. The output is stored in an
object of class marg
.
# S3 method for rsm
cond(object, offset, formula = NULL, family = NULL,
dispersion = NULL, data = sys.frame(sys.parent()), pts = 20,
n = max(100, 2*pts), tms = 0.6, from = NULL, to = NULL,
control = glm.control(…), trace = FALSE, …)
a rsm
object; for instance the result of a call to
rsm
.
either the covariate occurring in the model formula whose
coefficient represents the parameter of interest or scale
if the parameter of interest is the scale parameter. In the first
case, the variable may be numerical or a two-level factor. In case
of a two-level factor, it must be coded by contrasts and not as two
dummy variables. Can also be a call to a mathematical function
(such as exp
, sin
, …) or to a mathematical
operator (^
, /
, …) applied to a numerical
variable. The call must always agree with the label used to identify
the corresponding parameter in the rsm
object passed through
the object
argument or defined by formula
and
family
. Beware that the label includes the identity
function I()
if an arithmetic operator was used. Other
function types (e.g. factor
) and interactions are not
admitted. If interest focuses on the scale parameter, it must not
be fixed in object
or when using the dispersion
argument in case no rsm
object is supplied.
a formula expression (only if no rsm
object is defined).
a family.rsm
object defining the error distribution (only if
no rsm
object is defined). See rsm.families
for the families supported.
argument only to be used if no rsm
object is defined. If
NULL
, the scale parameter is taken to be unknown. If known,
the numerical value can be passed. The default is NULL
.
Huber's least favourable error distribution represents a special
case. If dispersion
is NULL
, the maximum likelihood
estimate is computed, while if TRUE
the MAD
estimate is calculated and the scale parameter fixed to this value
in subsequent computations.
an optional data frame in which to interpret the variables
occurring in the formula (only if no rsm
object is defined).
number of output points (minimum 10) that are calculated exactly; the default is 20.
approximate number of output points (minimum 50) produced by the
spline interpolation. The default is the maximum between 100 and
twice pts
.
defines the range MLE +/- tms
* s.e.
where cubic spline interpolation is replaced by polynomial
interpolation. The default is 0.6.
starting value of the sequence that contains the values of the parameter of interest for which output points are calculated exactly. The default is MLE - 3.5 * s.e.
ending value of the sequence that contains the values of the parameter of interest for which output points are calculated exactly. The default is MLE + 3.5 * s.e.
a list of iteration and algorithmic constants that control the
rsm
fit. See glm.control
for their names and
default values.
if TRUE
, iteration numbers will be printed.
additional arguments, such as weights
, subset
,
control
etc. used by the rsm
fitting routine if the
rsm
object is defined through formula
and
family
. See rsm
for their definition and use.
The returned value is an object of class marg
; see
marg.object
for details.
This function is a method for the generic function cond
for class rsm
. It can be invoked by calling cond
for
an object of the appropriate class, or directly by calling
cond.rsm
regardless of the class of the object.
cond.rsm
has also to be used if the rsm
object is not
provided throught the object
argument but specified by
formula
and family
.
The function cond.rsm
implements several small sample
asymptotic methods for approximate conditional inference in
regression-scale models. Approximations for both the modified/marginal
log likelihood function and approximate conditional/marginal tail
probabilities are
available (see marg.object
for details). Attention is
restricted to a scalar parameter of interest, either a regression
coefficient or the scale parameter. In the first case, the
associated covariate may be either numerical or a two-level factor.
Approximate conditional (or equivalently marginal) inference is performed
by either updating a
fitted regression-scale model or defining the model formula and
family. All approximations are calculated exactly for pts
equally spaced points ranging from from
to to
. A
spline interpolation is used to extend them over the whole interval
of interest, except for the range of values defined by MLE
+/- tms
* s.e. where the spline interpolation is
replaced by a higher order polynomial interpolation. This is done
in order to avoid numerical instabilities which are likely to occur
for values of the parameter of interest close to the MLE.
Results
are stored in an object of class marg
. Method functions
like print
, summary
and
plot
can be used to examine the output or
represent it graphically. Components can be extracted using
coef
, formula
and
family
.
Main references for the methods considered are the papers by Barndorff-Nielsen (1991), DiCiccio, Field and Fraser (1990) and DiCiccio and Field (1991). The theory and statistics used are summarized in Brazzale (2000, Chapters 2 and 3). More details of the implementation are given in Brazzale (1999; 2000, Section 6.3.1).
Barndorff-Nielsen, O. E. (1991) Modified signed log likelihood ratio. Biometrika, 78, 557--564.
Brazzale, A. R. (1999) Approximate conditional inference for logistic and loglinear models. J. Comput. Graph. Statist., 8, 653--661.
Brazzale, A. R. (2000) Practical Small-Sample Parametric Inference. Ph.D. Thesis N. 2230, Department of Mathematics, Swiss Federal Institute of Technology Lausanne.
DiCiccio, T. J., Field, C. A. and Fraser, D. A. S. (1990) Approximations of marginal tail probabilities and inference for scalar parameters. Biometrika, 77, 77--95.
DiCiccio, T. J. and Field, C. A. (1991) An accurate method for approximate conditional and Bayesian inference about linear regression models from censored data. Biometrika, 78, 903--910.
# NOT RUN {
## Sea Level Data
data(venice)
attach(venice)
Year <- 1:51/51
c11 <- cos(2*pi*1:51/11) ; s11 <- sin(2*pi*1:51/11)
c19 <- cos(2*pi*1:51/18.62) ; s19 <- sin(2*pi*1:51/18.62)
##
## quadratic model fitted to the sea level, includes 18.62-year
## astronomical tidal cycle and 11-year sunspot cycle
venice.rsm <- rsm(sea ~ Year + I(Year^2) + c11 + s11 + c19 + s19,
family = extreme)
names(coef(venice.rsm))
## "(Intercept)" "Year" "I(Year^2)" "c11" "s11" "c19" "s19"
##
## variable of interest: quadratic term
venice.marg <- cond(venice.rsm, I(Year^2))
##
detach()
## House Price Data
data(houses)
houses.rsm <- rsm(price ~ ., family = student(5), data = houses)
##
## parameter of interest: scale parameter
houses.marg <- cond(houses.rsm, scale)
# }
Run the code above in your browser using DataLab