fullposet: Get a set of pseudo-observation observation indices

Description Usage Arguments Details Value See Also Examples

Description

Get a set of pseudo-observation observation indices

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
fullposet(data, formula, weights = NULL, verbosity = 0)

noselfposet(data, formula, weights = NULL, verbosity = 0)

lexiposet(data, formula, weights = NULL, verbosity = 0)

onewayposet(data, formula, weights = NULL, verbosity = 0)

forcedcolorderonewayposet(columnnames = NULL)

forcedposet(diffcols = NULL, LLessRcols = NULL, RLessLcols = NULL,
  no.equals = TRUE)

Arguments

data

Context where the formula formula is to be interpreted

formula

Original formula

weights

Vector of weights per row of data or NULL.

verbosity

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

columnnames

column names that will be used to imply order.

diffcols

column names that will be used to imply order.

LLessRcols

column names where you want the left observation to be smaller.

RLessLcols

column names where you want the right observation to be smaller

no.equals

if TRUE (the default), rows that have equal values in the LLessRcols or RLessLcols columns are excluded from being combined.

Details

The provided implementations differ as follows:

  1. fullposet Contains all combinations of rowindices.

  2. noselfposet The same as fullposet, but excluding the rowcombinations with identical indexes.

  3. lexiposet Check that predicting variables can be ordered, and select only combinations where the predictors are bigger on the right side.

  4. onewayposet Similar to lexiposet, but simply uses row index.

  5. forcedcolorderonewayposet First reorders the data based on a set of given column names. Note: the other functions here are to be passed along as poset=fullposet, this one needs poset=forcedcolorderonewayposet(c("col1", "col2"))

  6. forcedposet Starts from all observations, but excludes the ones where

    • the combinations of the columns in diffcols are the same in left and right observation

    • the combinations of the columns in LLessRcols in the left observation are greater than the one in the right observation (equals are dropped too if no.equals=TRUE)

    • the combinations of the columns in RLessLcols in the right observation are greater than the one in the left observation (equals are dropped too if no.equals=TRUE)

    As a side effect, the data is also sorted wrt the LLessRcols (ascending) and then according to the RLessLcols (descending).

  7. oldpimposet and oldpimposetbft Sorts the data according to all predictors, then does oneway-style. These are mainly provided for comparison to a previous implementations of pim.

Value

List with 3 items:

data

Similar to the passed along data, but may contain fewer rows.

poset

Matrix of two columns indicating what the original observation number is for the left and right real observation in the pseudo-observation.

weights

Weight to be applied to each row of the dataset. Should contain one weight per row of data (and match its order) or equal NULL. Important: if order of data is changed/rows are left out: update weights as well!

See Also

pim

Examples

1
2
3
4
5
set.seed(1)
	dta<-data.frame(y=runif(6), x=ordered(sample(3, 6, replace=TRUE)))
	fullposet(dta, y~x)$poset
	lexiposet(dta, y~x)$poset
	onewayposet(dta, y~x)$poset

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