Title: | Binomial Linear Regression |
---|---|
Description: | Implements regression models for binary data on the absolute risk scale. These models are applicable to cohort and population-based case-control data. |
Authors: | S. Kovalchik |
Maintainer: | S.Kovalchik <[email protected]> |
License: | GPL (>= 2) |
Version: | 2022.0.0.1 |
Built: | 2025-02-12 03:54:59 UTC |
Source: | https://github.com/cran/blm |
The functions blm
and lexpit
implement a binomial linear and linear-expit regression model. Estimates are the maximum likelihood estimates with constrained optimization through adaptive barrier method to ensure that estimable probabilities are in the (0,1) interval.
Package: | blm |
Type: | Package |
Version: | 2013.2.4.4 |
Date: | 2013-8-14 |
Depends: | R (>= 2.10.1), methods |
Imports: | stats, stats4 |
License: | GPL (>= 2) |
LazyLoad: | yes |
Maintainer: Stephanie Kovalchik <[email protected]>
Kovalchik S, Varadhan R (2013). Fitting Additive Binomial Regression Models with the R Package blm. Journal of Statistical Software, 54(1), 1-18. URL: https://www.jstatsoft.org/v54/i01/.
The aarp
data set is a nested case-control study of bladder cancer outcomes in the NIH-AARP Diet and Health Study. The data set is intended for demonstration purposes only.
aarp
aarp
bladder70: | indicator of bladder cancer by age 70 years |
female: | indicator of female gender |
smoke_status: | factor of smoking status (four categories) |
w: | inverse of sampling fraction |
redmeat: | total daily redmeat consumption (grams/day) |
fiber.centered: | total daily fiber consumption (grams), centered on sample median |
educ: | factor of education status (six categories) |
National Cancer Institute. National Institutes of Health AARP Diet and Health Study. https://dceg.cancer.gov/research/who-we-study/nih-aarp-diet-health-study. Accessed: 12/10/2012
data(aarp) # ABSOLUTE RISK OF BLADDER CANCER BY 70 YEARS # FOR DIFFERENT GENDER AND RISK GROUP fit <- blm(bladder70~female * smoke_status, data = aarp, weight=aarp$w) # INTERCEPT IS BASELINE RISK # ALL OTHER COEFFICIENTS ARE RISK DIFFERENCES FROM BASELINE summary(fit)
data(aarp) # ABSOLUTE RISK OF BLADDER CANCER BY 70 YEARS # FOR DIFFERENT GENDER AND RISK GROUP fit <- blm(bladder70~female * smoke_status, data = aarp, weight=aarp$w) # INTERCEPT IS BASELINE RISK # ALL OTHER COEFFICIENTS ARE RISK DIFFERENCES FROM BASELINE summary(fit)
A direct probability model for regression with a binary outcome from observational data.
blm(formula, data, na.action = na.omit, weights = NULL, strata = NULL, par.init = NULL, warn=FALSE,...)
blm(formula, data, na.action = na.omit, weights = NULL, strata = NULL, par.init = NULL, warn=FALSE,...)
formula |
formula for linear model for binary outcome, |
data |
data.frame containing the variables of |
na.action |
function specifying how missing data should be handled, na.action |
weights |
Vector of weights equal to the number of observations. For population-based case-control study, weights are the inverse sampling fractions for controls. |
strata |
vector indicating the stratification for weighted regression with stratified observational data |
par.init |
vector (optional) of initial parameters |
warn |
logical indicator whether to include warnings during algorithm fitting. Default of |
... |
Additional arguments passed to |
The blm
model coefficients are the solutions to the maximum of a pseudo log-likelihood using a constrained optimization algorithm with an adaptive barrier method, constrOptim
(Lange, 2010). Variance estimates are based on Taylor linearization (Shah, 2002). When weights
are not NULL, it is assumed that the study is a case-control design.
Returns an object of class blm
.
S. Kovalchik [email protected]
Kovalchik S, Varadhan R (2013). Fitting Additive Binomial Regression Models with the R Package blm. Journal of Statistical Software, 54(1), 1-18. URL: https://www.jstatsoft.org/v54/i01/.
Lange, K. (2010) Numerical Analysis for Statisticians, Springer.
Shah, BV. (2002) Calculus of Taylor deviations. Joint Statistical Meetings.
data(ccdata) fit <- blm(y~female+packyear, weights = ccdata$w,strata=ccdata$strata, data=ccdata) summary(fit) data(aarp) # ABSOLUTE RISK OF BLADDER CANCER BY 70 YEARS # FOR DIFFERENT GENDER AND RISK GROUP fit <- blm(bladder70~female * smoke_status, data = aarp, weight=aarp$w) logLik(fit) # INTERCEPT IS BASELINE RISK # ALL OTHER COEFFICIENTS ARE RISK DIFFERENCES FROM BASELINE summary(fit) # RISK DIFFERENCE CONFIDENCE INTERVALS (PER 1,000 PERSONS) confint(fit)*1000
data(ccdata) fit <- blm(y~female+packyear, weights = ccdata$w,strata=ccdata$strata, data=ccdata) summary(fit) data(aarp) # ABSOLUTE RISK OF BLADDER CANCER BY 70 YEARS # FOR DIFFERENT GENDER AND RISK GROUP fit <- blm(bladder70~female * smoke_status, data = aarp, weight=aarp$w) logLik(fit) # INTERCEPT IS BASELINE RISK # ALL OTHER COEFFICIENTS ARE RISK DIFFERENCES FROM BASELINE summary(fit) # RISK DIFFERENCE CONFIDENCE INTERVALS (PER 1,000 PERSONS) confint(fit)*1000
Class for binomial linear regression (BLM).
Objects can be created by calls of the form new("blm", ...)
.
coef
:vector of fitted coefficients
vcov
:matrix of variance-covariate estimates for coef
formula
:model formula
df.residual
:residual degrees of freedom
data
:data frame used in fitting, after applying na.action
which.kept
:vector of index of values in original data source that were used in the model fitting
y
:response vector for fitted model
weights
:vector of weights used in model fitting
strata
:stratification factor for weighted regression.
converged
:logical message about convergence status at the end of algorithm
par.init
:initial parameter values for optimization algorithm
loglik
value of log-likelihood (normalized for weighted likelihood) under full model
loglik.null
value of log-likelihood (normalized for weighted likelihood) under null model
barrier.value
value of the barrier function at the optimum
signature(object = "blm")
:
Display point estimates of blm
object.
signature(x = "blm",...)
:
Display point estimates of blm
object.
signature(object = "blm",...)
:
List of estimates and convergence information.
signature(object = "blm")
:
Extractor for fitted coefficients.
signature(object = "blm")
:
Extractor for log-likelihood of blm
model.
signature(object = "blm")
:
Extractor for formula of blm
object.
signature(object = "blm")
:
Extractor for residuals.
signature(object = "blm")
:
Extractor for variance-covariance based on Taylor series large-sample Hessian approximation with the pseudo-likelihood of the constrained optimization.
signature(object = "blm")
:
Returns vector of linear predictors for each subject of the fitted model.
signature(object = "blm", parm, level = 0.95,...)
:
Returns confidence interval (at a given level
) for the specified regression parameters.
Simulated population-based case-control dataset
ccdata
ccdata
female: | indicator for female gender |
packyear: | discrete variable representing pack-years smoked |
strata: | stratification variable |
y: | indicator of case status (1 for case, 0 for control) |
w: | inverse of sampling fraction |
blm
and lexpit
objects.Extract vector of coefs of the fit of a blm
or lexpit
model.
signature(object = "blm")
:
Extractor for MLEs returned as a matrix with one column.
S. Kovalchik [email protected]
blm
and lexpit
objects.Return the confidence intervals for specified parameters and confidence level.
signature(object = "blm", parm, level = 0.95,...)
:
Returns confidence interval (at a given level
) for the specified regression parameters.
signature(object = "lexpit", parm, level = 0.95,...)
:
Returns confidence interval (at a given level
) for the specified regression parameters.
Stephanie Kovalchik [email protected]
data(ccdata) fit <- lexpit(y~female, y~packyear, data = ccdata, weight = ccdata$w, strata = ccdata$strata) confint(fit)
data(ccdata) fit <- lexpit(y~female, y~packyear, data = ccdata, weight = ccdata$w, strata = ccdata$strata) confint(fit)
Calculates the weighted average crude risk against the average exposure level for a continuous exposure. Each point corresponds to overlapping subgroups of 20 percent of the sample ordered from lowest to highest exposure and a sliding window of 1
crude.risk(formula, data, weights = NULL, na.action = na.omit)
crude.risk(formula, data, weights = NULL, na.action = na.omit)
formula |
formula specifying the binary outcome and the continuous covariate of interest, e.g. |
data |
dataframe containing the variables specified in |
weights |
vector of sample weights |
na.action |
function used for handling missing variables in the variables of |
The crude.risk
function is intended to explore the possible functional relationship between risk and exposure in a non-parametric way.
S. Kovalchik [email protected]
data(aarp) risk <- crude.risk(bladder70~redmeat, weights = aarp$w, data = aarp) risk.exposure.plot(risk, xlab = "Avg. Red Meat Consumption")
data(aarp) risk <- crude.risk(bladder70~redmeat, weights = aarp$w, data = aarp) risk.exposure.plot(risk, xlab = "Avg. Red Meat Consumption")
blm
and lexpit
objects.Returns a list of expected to observed counts and the specified confidence interval. The argument group
can be used to estimate this ratio by the categories of the categorical variable group
. If population-based case-control data is used to fit the model, the expected counts are for the population and make use of the sampling weights.
EO(object, index = NULL, level = 0.95)
EO(object, index = NULL, level = 0.95)
object |
object of class |
index |
factor for computing E/O comparison by subgroups |
level |
numeric, confidence level (between 0 and 1) for the E/O ratios |
Data frame with:
E
expected count
O
observed counts
EtoO
ratio of expected to observed
lowerCI
lower endpoint of confidence interval for E over O ratio
upperCI
upper endpoint of confidence interval for E over O ratio
Stephanie Kovalchik [email protected]
data(ccdata) fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) EO(fit) EO(fit, ccdata$strata) # BY FACTOR
data(ccdata) fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) EO(fit) EO(fit, ccdata$strata) # BY FACTOR
Returns the inverse logit. Where,
expit(x)
expit(x)
x |
numeric vector |
Numeric that is the inverse logit of x
.
expit(1:10)
expit(1:10)
blm
and lexpit
objects.Computes the deviance and Pearson chi-squared statistics for the fit from a blm
or lexpit
model. These tests are appropriate when all predictors are categorical and there are many replicates within each covariate class.
Returns a list with table
, with expected E
and observed O
, and the chi-square test chisq
and p-value (p.value
) for the Pearson goodness-of-fit test. The observed and expected count are listed in the order of the unique levels formed by the design matrix.
When sample weights are present, the goodness-of-fit test is a modified F-test as suggested by Archer et al. (2007).
gof(object)
instance of blm
or lexpit
Stephanie Kovalchik [email protected]
Archer KJ, Lemeshow S, Hosmer DW. Goodness-of-fit tests for logistic regression models when data are collected using a complex sampling design. Computational Statistics & Data Analysis. 2007;51:4450–4464.
data(ccdata) ccdata$packyear <- ccdata$packyear+runif(nrow(ccdata)) # UNWEIGHTED GOF fit <- blm(y~female+packyear,data = ccdata) gof(fit) # WEIGHTED GOF fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w) gof(fit)
data(ccdata) ccdata$packyear <- ccdata$packyear+runif(nrow(ccdata)) # UNWEIGHTED GOF fit <- blm(y~female+packyear,data = ccdata) gof(fit) # WEIGHTED GOF fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w) gof(fit)
blm
and lexpit
objects.Computes the deviance and Pearson chi-squared statistics for the fit from a blm
or lexpit
model. These tests are appropriate when all predictors are categorical and there are many replicates within each covariate class.
Returns a list with expected E
and observed O
and the chi-square test chisq
and p-value (p.value
) for the Pearson goodness-of-fit test. The observed and expected count are listed in the order of the unique levels formed by the design matrix.
gof.pearson(object)
instance of blm
or lexpit
Stephanie Kovalchik [email protected]
data(ccdata) fit <- blm(y~female+I(packyear>20),data = ccdata, weight = ccdata$w, strata = ccdata$strata) gof.pearson(fit)
data(ccdata) fit <- blm(y~female+I(packyear>20),data = ccdata, weight = ccdata$w, strata = ccdata$strata) gof.pearson(fit)
A direct probability model for regression with a binary outcome from observational data. Covariate effects are the sum of additive terms and an expit term, which allows some explanatory variables to be additive and others non-linear.
lexpit(formula.linear,formula.expit,data,na.action=na.omit, weights=NULL,strata=NULL,par.init=NULL, warn = FALSE, control.lexpit=list(max.iter=1000,tol=1E-7),...)
lexpit(formula.linear,formula.expit,data,na.action=na.omit, weights=NULL,strata=NULL,par.init=NULL, warn = FALSE, control.lexpit=list(max.iter=1000,tol=1E-7),...)
formula.linear |
formula for linear model for binary outcome, |
formula.expit |
formula for expit model, linear in expit, |
data |
data.frame containing the variables of |
na.action |
function specifying how missing data should be handled, na.action |
weights |
Vector of weights equal to the number of observations. For population-based case-control study, weights are the inverse sampling fractions for controls. |
strata |
vector indicating the stratification for weighted regression with stratified observational data |
par.init |
list (optional) of initial parameters for |
warn |
logical indicator whether to include warnings during algorithm fitting. Default of |
control.lexpit |
list with control parameters for optimization algorithm |
... |
Additional arguments passed to |
lexpit
model uses a two-stage optimization procedure. At the first stage linear terms the solutions to the maximum of a pseudo log-likelihood using a constrained optimization algorithm with an adaptive barrier method, constrOptim
(Lange, 2010). The second stage maximizes the pseudo log-likelihood with respect to the expit terms using iterative reweighted least squares with an offset term for the linear component of the model.
Variance estimates are based on Taylor linearization (Shah, 2002). When weights
are not NULL, it is assumed that the study is a case-control design.
Returns an object of class lexpit
.
S. Kovalchik [email protected]
Kovalchik S, Varadhan R (2013). Fitting Additive Binomial Regression Models with the R Package blm. Journal of Statistical Software, 54(1), 1-18. URL: https://www.jstatsoft.org/v54/i01/.
Lange, K. (2010) Numerical Analysis for Statisticians, Springer.
Shah, BV. (2002) Calculus of Taylor deviations. Joint Statistical Meetings.
data(ccdata) fit <- lexpit(y~female,y~packyear,weights = ccdata$w, strata=ccdata$strata,data=ccdata) summary(fit) # LEXPIT MODEL FOR BLADDER CANCER RISK BY AGE 70 formula.linear <- bladder70~female * smoke_status formula.expit <- bladder70~redmeat+fiber.centered+I(fiber.centered^2) # ADDITIVE EFFECTS FOR GENDER AND SMOKING # LOGISTIC EFFECTS FOR FIBER AND REDMEAT CONSUMPTION data(aarp) fit <- lexpit(formula.linear, formula.expit, aarp, weight=aarp$w) logLik(fit) model.formula(fit) # SUMMARY summary(fit) confint(fit) # FITTED ABSOLUTE RISK PER 1,000 PERSONS head(predict(fit)*1000)
data(ccdata) fit <- lexpit(y~female,y~packyear,weights = ccdata$w, strata=ccdata$strata,data=ccdata) summary(fit) # LEXPIT MODEL FOR BLADDER CANCER RISK BY AGE 70 formula.linear <- bladder70~female * smoke_status formula.expit <- bladder70~redmeat+fiber.centered+I(fiber.centered^2) # ADDITIVE EFFECTS FOR GENDER AND SMOKING # LOGISTIC EFFECTS FOR FIBER AND REDMEAT CONSUMPTION data(aarp) fit <- lexpit(formula.linear, formula.expit, aarp, weight=aarp$w) logLik(fit) model.formula(fit) # SUMMARY summary(fit) confint(fit) # FITTED ABSOLUTE RISK PER 1,000 PERSONS head(predict(fit)*1000)
Class for linear-expit regression (lexpit).
Objects can be created by calls of the form new("lexpit", ...)
.
coef.linear
:vector of fitted linear coefficients
coef.expit
:vector of fitted expit coefficients
vcov.linear
:matrix of variance-covariate estimates for linear coef
vcov.expit
:matrix of variance-covariate estimates for expit coef
formula.linear
:model formula for linear component
formula.expit
:model formula for expit component
df.residual
:residual degrees of freedom
p
:number of linear parameters
q
:number of expit parameters
data
:data frame used in fitting, after applying na.action
which.kept
:vector of index of values in original data source that were used in the model fitting
y
:response vector for fitted model
weights
:vector of weights used in model fitting
strata
:stratification factor for weighted regression.
converged
:logical message about convergence status at the end of algorithm
par.init
:initial parameter values for optimization algorithm
loglik
value of log-likelihood (normalized for weighted likelihood) under full model
loglik.null
value of log-likelihood (normalized for weighted likelihood) under null model
barrier.value
value of the barrier function at the optimum
control.lexpit
list with control parameters for optimization algorithm
signature(object = "lexpit")
:
Display point estimates of lexpit
object.
signature(x = "lexpit",...)
:
Display point estimates of lexpit
object.
signature(object = "lexpit",...)
:
List of estimates and convergence information.
signature(object = "lexpit")
:
Extractor for fitted coefficients.
signature(object = "lexpit")
:
Extractor for log-likelihood of lexpit
model.
signature(object = "lexpit")
:
Extractor for formula of lexpit
object.
signature(object = "lexpit")
:
Extractor for variance-covariance based on Taylor series large-sample Hessian approximation with the pseudo-likelihood of the constrained optimization.
signature(object = "lexpit")
:
Extractor for residuals.
signature(object = "lexpit")
:
Returns vector of linear predictors for each subject of the fitted model.
signature(object = "lexpit", parm, level = 0.95,...)
:
Returns confidence interval (at a given level
) for the specified regression parameters.
Returns the logit. Where,
logit(x)
logit(x)
x |
numeric vector |
Numeric that is the logit of x
.
logit(1:10)
logit(1:10)
blm
and lexpit
objects.Method to access the log-likelihood of the fitted blm
or lexpit
model.
The return object is of the logLik
class. This method is registered with the stats4 package and can therefore be used with applicable methods like AIC and BIC.
Note that when weights are used in the model estimation, the logLik
is a pseduo-log-likelihood.
signature(object = "blm",...)
:
Extract log-likelihood. Returns object of logLik
class.
signature(object = "lexpit",...)
:
Extract log-likelihood. Returns object of logLik
class.
Stephanie Kovalchik [email protected]
data(ccdata) fit <- lexpit(y~female, y~packyear, data = ccdata, weight = ccdata$w, strata = ccdata$strata) logLik(fit) AIC(fit)
data(ccdata) fit <- lexpit(y~female, y~packyear, data = ccdata, weight = ccdata$w, strata = ccdata$strata) logLik(fit) AIC(fit)
Computes the likelihood ratio test for the significance of the specified variable in a lexpit or BLM model fit to cohort data. This method is only valid for study designs that use simple random sampling.
LRT(object, var)
LRT(object, var)
object |
a model of the |
var |
character name of |
A matrix with the LRT statistic and p-value for the test of the significance of the specified variable given all other variables in the model.
S. Kovalchik [email protected]
cohort <- data.frame( x1 = runif(500), x2 = runif(500) ) cohort$event <- rbinom(n=nrow(cohort),size=1, prob=0.25+0.1*cohort$x1+.1*cohort$x2) fit <- blm(event~x1+x2, data=cohort) summary(fit) LRT(fit, "x1") LRT(fit, "x2")
cohort <- data.frame( x1 = runif(500), x2 = runif(500) ) cohort$event <- rbinom(n=nrow(cohort),size=1, prob=0.25+0.1*cohort$x1+.1*cohort$x2) fit <- blm(event~x1+x2, data=cohort) summary(fit) LRT(fit, "x1") LRT(fit, "x2")
blm
and lexpit
objects.Extract vector of formula of the fit of a blm
or the formulas for the lexpit
model.
signature(object = "blm")
:
Extractor for formula of blm
object.
signature(object = "lexpit")
:
Extractor for formulas of lexpit
object. Returns a list containing the linear
and expit
formulas.
S. Kovalchik [email protected]
blm
and lexpit
objects.Computes vector of risk predictions for the dataset used to fit the model. As with method predict.glm
, standard errors for fitted values can be requested and predictions for the covariates of the data frame newdata
can be computed rather than the default computation of all fitted values for the data frame used for model fitting.
signature(object = "blm", newdata, se = FALSE)
:
Risk predictions for fit design matrix.
signature(object = "lexpit", newdata, se = FALSE)
:
Risk predictions for fit design matrix.
Stephanie Kovalchik [email protected]
data(ccdata) fit <- lexpit(y~female, y~packyear, data = ccdata, weight = ccdata$w, strata = ccdata$strata) predict(fit)[1:10]
data(ccdata) fit <- lexpit(y~female, y~packyear, data = ccdata, weight = ccdata$w, strata = ccdata$strata) predict(fit)[1:10]
blm
and lexpit
model fit.Prints the regression coefficients of the fit of a blm
or lexpit
model.
signature(x = "blm")
:
Call and coefficient estimates.
signature(x = "lexpit")
:
Call and coefficient estimates.
Stephanie Kovalchik [email protected]
blm
and lexpit
objects.Extract residuals of model fit.
signature(object = "blm")
:
Extractor for residuals of blm
object.
signature(object = "lexpit")
:
Extractor for residuals of blm
object.
Stephanie Kovalchik [email protected]
Calculates the weighted average crude risk against the average exposure level for a continuous exposure. Each point corresponds to overlapping subgroups of 20 percent of the sample ordered from lowest to highest exposure and a sliding window of 1
risk.exposure.plot(object, scale=1,...)
risk.exposure.plot(object, scale=1,...)
object |
list or data.frame with |
scale |
multiplicative factor to modify scale of crude risk estimates |
... |
additional arguments passed to scatter.smooth |
The risk-exposure scatter plot is intended to explore the possible functional relationship between risk and exposure.
S. Kovalchik [email protected]
data(aarp) risk <- crude.risk(bladder70~redmeat, weights = aarp$w, data = aarp) risk.exposure.plot(risk, xlab = "Avg. Red Meat Consumption")
data(aarp) risk <- crude.risk(bladder70~redmeat, weights = aarp$w, data = aarp) risk.exposure.plot(risk, xlab = "Avg. Red Meat Consumption")
blm
and lexpit
objects.Returns McFadden's unadjusted and adjusted R-squared measures for models of a binary outcome.
Rsquared(object)
Rsquared(object)
object |
object of class |
List of R2
and R2adj
.
Stephanie Kovalchik [email protected]
data(ccdata) fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) Rsquared(fit)
data(ccdata) fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) Rsquared(fit)
blm
and lexpit
model fit.Print estimates of a blm
or lexpit
model fit.
signature(object = "blm")
:
Call and coefficient estimates.
signature(object = "lexpit")
:
Call and coefficient estimates.
Stephanie Kovalchik [email protected]
blm
and lexpit
model fit.A list of estimates and convergence status of a blm
or lexpit
model fit.
signature(object = "blm")
:
Matrix of estimates and convergence information.
signature(object = "lexpit")
:
Matrix of estimates and convergence information.
The matrix returned has the named components:
vector of estimated regression coefficients. For lexpit model estimates are split into est.linear
and est.expit
components of list
standard error of model estimates
t-value of model estimates
p-value (two-sided) of model estimates
S. Kovalchik [email protected]
data(ccdata) fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) summary(fit) fit.lexpit <- lexpit(y~female, y~packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) summary(fit.lexpit)
data(ccdata) fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) summary(fit) fit.lexpit <- lexpit(y~female, y~packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) summary(fit.lexpit)
blm
and lexpit
objects.Returns Hessian-based variance-covariance matrix of the fit of a blm
or lexpit
model. If any constraints are active, only the augmented Lagrangian takes this into account in the Hessian computation, so if augmented
is FALSE
, i.e. the adaptive barrier method of optimization is used, the covariance-variance might be inaccurate.
signature(object = "blm")
:
Extractor for variance-covariance of MLEs.
signature(object = "lexpit")
:
Extractor for variance-covariance of MLEs.
Stephanie Kovalchik [email protected]
blm
and lexpit
objects.Returns matrix of covariate types with a predicted probability at the lower or upper boundary defined by the specified criterion
or NA
if no boundary constraints are present.
Returns all rows of design matrix whose predicted risk are less than or equal to criterion
or greater than or equal to 1 - criterion
.
which.at.boundary (object, criterion = 1e-06)
model fit of class blm
or lexpit
numeric distance from 0 (or 1) that is considered to be at the boundary
Stephanie Kovalchik [email protected]
data(ccdata) fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) which.at.boundary(fit)
data(ccdata) fit <- blm(y~female+packyear,data = ccdata, weight = ccdata$w, strata = ccdata$strata) which.at.boundary(fit)