pimsym: Check the symmetry condition for a PIM

Description Usage Arguments Details Value See Also Examples

Description

Check the symmetry condition for a PIM

Usage

1
2
3
4
5
6
pimsym(formula, data, link = c("logit", "identity", "probit", "inverse",
  "1/mu^2", "log"), blocking.variables = character(), leftsuffix = "_L",
  rightsuffix = "_R", interpretation = c("difference", "regular",
  "marginal", "symmetric"), na.action = na.fail, lhs = c("PO", "<", "<="),
  verbosity = 0, interactions.difference = (interpretation != "marginal"),
  threshold = 1e-06)

Arguments

formula

Original formula

data

Context where the formula formula is to be interpreted

link

Name of the link function (defaults to "logit")

blocking.variables

Character vector holding column names that hold blocking variables.

leftsuffix, rightsuffix

Suffixes that will be added to the 'left' and 'right' observation's column name in the pseudo-observation. Note: no checking is done that these suffixes are safe, so the wrong suffixes may lead to unexpected behaviour.

interpretation

If "marginal" parts of the formula are converted to imply marginal pim modeling (see e.g. Mainreplacetext). If it is "difference" (the default), then the design matrix of the PIM is the difference of the design matrices of each part of the pseudo-observations. A popular option is "regular", which will interpret unaltered columns as differences. A new option is "symmetric", which works the same as "regular", but will enforce the symmetry condition by making the sign switch when changing the order (typically, this is achieved by subtracting the inverse for each dummy).

na.action

Defaults to na.fail: handles missing data in data.

lhs

"PO", "<" or "<=": Unequality used for the lefthandside of the formula. The default ("PO") is the normal probabilistic index.

verbosity

The higher this value, the more levels of progress and debug information is displayed (note: in R for Windows, turn off buffered output)

interactions.difference

If TRUE (note that the default is interpretation!="marginal") interaction terms will be interpreted as the differences of the onesided interaction terms (if this is possible at all). This is unsupported if unsupported if is "marginal". Some special interaction terms with calculated columns may lead to unexpected behaviour.

threshold

When checking the symmetry condition, how much digression is allowed.

Details

This check is implemented by taking a random set of coefficients (from uniform distributions over ]-0.5,0.5[) and comparing the predicted probabilities based on them. So: not a formal check, though the error should be ignorable.

Be aware that for sizeable datasets, this check may take quite some time and (temporarily) use a lot of memory.

Note that the same check is performed by pim.fit.prep (and thus by pim) when check.symmetric=TRUE.

Value

TRUE if the symmetry condition appears to be fulfilled.

See Also

estimator.nleqslv varianceestimator.sandwich

Examples

1
2
3
4
5
6
7
8
9
set.seed(1)
iris$out<-factor(sample(2, nrow(iris), replace=TRUE))
iris$xord<-as.ordered(iris$Species)
pima<-pim(out~Sepal.Length, data=iris, link="logit", interpretation="regular")
pimb<-pim(out~I((R(Sepal.Length) - L(Sepal.Length))/sqrt(R(Sepal.Length) * L(Sepal.Length)) ), data=iris, 
	link="logit", interpretation="regular", extra.nicenames=data.frame(
		org="I((R(Sepal.Length) - L(Sepal.Length))/sqrt(R(Sepal.Length) * L(Sepal.Length)) )", 
		nice="Sepal.Length.WDiff", stringsAsFactors=FALSE))
pimc<-pim(out~O(xord), data=iris, link="logit", interpretation="regular")

pimold documentation built on May 2, 2019, 5:50 p.m.