statsmodels.genmod.cov_struct.GlobalOddsRatio

class statsmodels.genmod.cov_struct.GlobalOddsRatio(endog_type)[source]

Estimate the global odds ratio for a GEE with ordinal or nominal data.

Notes

The following data structures are calculated in the class:

‘ibd’ is a list whose i^th element ibd[i] is a sequence of integer pairs (a,b), where endog_li[i][a:b] is the subvector of binary indicators derived from the same ordinal value.

cpp is a dictionary where cpp[group] is a map from cut-point pairs (c,c’) to the indices of all between-subject pairs derived from the given cut points.

References

PJ Heagerty and S Zeger. “Marginal Regression Models for Clustered Ordinal Measurements”. Journal of the American Statistical Association Vol. 91, Issue 435 (1996).

Thomas Lumley. Generalized Estimating Equations for Ordinal Data: A Note on Working Correlation Structures. Biometrics Vol. 52, No. 1 (Mar., 1996), pp. 354-361 http://www.jstor.org/stable/2533173

Methods

covariance_matrix(expected_value, index)

Returns the working covariance or correlation matrix for a given cluster of data.

covariance_matrix_solve(expval, index, …)

Solves matrix equations of the form covmat * soln = rhs and returns the values of soln, where covmat is the covariance matrix represented by this class.

get_eyy(endog_expval, index)

Returns a matrix V such that V[i,j] is the joint probability that endog[i] = 1 and endog[j] = 1, based on the marginal probabilities of endog and the global odds ratio current_or.

initialize(model)

Called by GEE, used by implementations that need additional setup prior to running fit.

observed_crude_oddsratio()

To obtain the crude (global) odds ratio, first pool all binary indicators corresponding to a given pair of cut points (c,c’), then calculate the odds ratio for this 2x2 table.

pooled_odds_ratio(tables)

Returns the pooled odds ratio for a list of 2x2 tables.

summary()

Returns a text summary of the current estimate of the dependence structure.

update(params)

Update the global odds ratio based on the current value of params.