new.pim.formula: Constructor for pim.formula

Description Usage Arguments Details Value See Also

Description

This function reworks a formula to a pim.formula for use in a probabilistic index model. This function is only meant to be used internally, but is exported. It should be used only in concordance with model.matrix.pim

Usage

1
2
3
4
5
6
7
new.pim.formula(formula, data, ...)

## S4 method for signature 'formula,pim.environment'
new.pim.formula(formula, data, ...)

## S4 method for signature 'formula,ANY'
new.pim.formula(formula, data, ...)

Arguments

formula

a formula object

data

either a pim.environment object containing the data for the pim, or an object that can be converted to a pim.environment by new.pim.env

...

extra arguments to new.pim.env

Details

It is the constructor to be used for a pim.formula object, and should only be used in conjunction with model.matrix.pim and pim.fit as shown in the examples.

Value

a pim.formula object.

See Also

pim.formula-class for more information on the class itself. PO, L and R for some functions that can be used in a pim.formula

#' @examples data("FEVData") # Create the "model frame" FEVenv <- new.pim.env(FEVData, compare="unique") # This includes the poset pos <- poset(FEVenv, as.list=TRUE)

# create the formula and bind it to the pim.environment. FEVform <- new.pim.formula( Age ~ I(L(Height) - R(Height)) , FEVenv )

# Use this formula object to construct the model matrix # use the default model ( difference ) MM <- model.matrix(FEVform)

# Use this formula object to construct the pseudo response Y <- response(FEVform)

# Now pim.fit can do what it does res <- pim.fit(MM,Y, estim = "estimator.glm", penv=FEVenv)


pim documentation built on March 26, 2020, 7:57 p.m.