Title: | Fixed Effects Logistic Model with High-Dimensional Parameters |
---|---|
Description: | A structured profile likelihood algorithm for the logistic fixed effects model and an approximate expectation maximization (EM) algorithm for the logistic mixed effects model. Based on He, K., Kalbfleisch, J.D., Li, Y. and Li, Y. (2013) <doi:10.1007/s10985-013-9264-6>. |
Authors: | Kevin(Zhi) He [aut], Wenbo Wu [aut], Michael Kleinsasser [cre] |
Maintainer: | Michael Kleinsasser <[email protected]> |
License: | GPL-2 |
Version: | 1.1 |
Built: | 2025-01-07 02:58:17 UTC |
Source: | https://github.com/umich-biostatistics/feprovider |
confint.fe.prov
computes the (1-alpha)% confidence intervals for the fixed
effect parameter estimates. Go to
Github for a tutorial.
## S3 method for class 'fe.prov' confint(object, parm = "all", level = 0.95, data, Y.char, Z.char, prov.char, ...)
## S3 method for class 'fe.prov' confint(object, parm = "all", level = 0.95, data, Y.char, Z.char, prov.char, ...)
object |
fitted model object (fit using |
parm |
provider IDs for which confidence intervals are desired. The default
is |
level |
confidence level (default is |
data |
prepared |
Y.char |
Y.char name of the response variable from |
Z.char |
Z.char names of covariates from |
prov.char |
name of provider IDs variable as a character string |
... |
extra arguments to be passed to confint |
Returns a data.frame
of gamma and SRR lower and upper CI bounds. Each row is a
parameter, each column gives a different bound.
He, K., Kalbfleisch, J.D., Li, Y. and Li, Y., 2013. Evaluating hospital readmission rates in dialysis facilities; adjusting for hospital effects. Lifetime data analysis, 19(4), pp.490-512.
fe.data.prep
, fe.prov
, test.fe.prov
,
funnel.SRR
# Name input variables and other parameters # a small positive number specifying stopping # criterion of Newton-Raphson algorithm tol <- 1e-5 Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) data(hospital_prepared) # build in data set fe.ls <- fe.prov(hospital_prepared, Y.char, Z.char, prov.char, tol) # model fitting # confidence intervals confint.fe.prov(fe.ls, parm = "all", level = 0.95, hospital_prepared, Y.char, Z.char, prov.char)
# Name input variables and other parameters # a small positive number specifying stopping # criterion of Newton-Raphson algorithm tol <- 1e-5 Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) data(hospital_prepared) # build in data set fe.ls <- fe.prov(hospital_prepared, Y.char, Z.char, prov.char, tol) # model fitting # confidence intervals confint.fe.prov(fe.ls, parm = "all", level = 0.95, hospital_prepared, Y.char, Z.char, prov.char)
fe.data.prep
prepares the data for model fitting with fe.prov
by
taking the data with missing values imputed. Go to
Github for a tutorial.
fe.data.prep(data, Y.char, Z.char, prov.char, cutoff = 10)
fe.data.prep(data, Y.char, Z.char, prov.char, cutoff = 10)
data |
a |
Y.char |
name of the response variable from |
Z.char |
names of covariates from |
prov.char |
name of provider IDs variable as a character string |
cutoff |
cutoff of provider size as an interger, default value is 10 |
data.frame
: a data frame sorted by provider IDs with additional
variables 'included', 'no.readm', 'all.readm' and missing values imputed.
He, K., Kalbfleisch, J.D., Li, Y. and Li, Y., 2013. Evaluating hospital readmission rates in dialysis facilities; adjusting for hospital effects. Lifetime data analysis, 19(4), pp.490-512.
fe.prov
, test.fe.prov
,
funnel.SRR
, confint.fe.prov
data(hospital) # build in data set # Name input variables and other parameters cutoff <- 10 # an integer as cutoff of facility (or provider) size with 10 as default alpha <- 0.05 # significance level Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) hospital_prepared <- fe.data.prep(hospital, Y.char, Z.char, prov.char, cutoff) # data preparation
data(hospital) # build in data set # Name input variables and other parameters cutoff <- 10 # an integer as cutoff of facility (or provider) size with 10 as default alpha <- 0.05 # significance level Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) hospital_prepared <- fe.data.prep(hospital, Y.char, Z.char, prov.char, cutoff) # data preparation
fe.prov
fits a fixed-effect logistic model using structured profile
likelihood algorithm. Standardized readmission ratios (SRRs) are also computed.
Go to Github for
a tutorial.
fe.prov(data, Y.char, Z.char, prov.char, tol = 1e-05, null = "median")
fe.prov(data, Y.char, Z.char, prov.char, tol = 1e-05, null = "median")
data |
prepared |
Y.char |
name of the response variable from |
Z.char |
names of covariates from |
prov.char |
name of provider IDs variable as a character string |
tol |
tolerance level for convergence. Default is |
null |
use median for null comparison |
An object of class fe.prov
, which is just a List
object with the following named elements:
beta:
a vector of fixed effect estimates
Obs:
a vector of responses for included providers
Exp:
a vector of expected probabilities of readmission within 30 days of discharge
iter:
number of iterations needed for convergence
beta.max.diff:
value of the stopping criterion
df.prov:
df.prov
is a data.frame
of provider-level information with the following items:
Obs:
provider-level observed number of readmissions within 30 days
Exp:
expected number of readmissions within 30 days
SRR:
standardized readmission ratios for each hospital
gamma:
a vector of provider effect estimates for included hospitals
He, K., Kalbfleisch, J.D., Li, Y. and Li, Y., 2013. Evaluating hospital readmission rates in dialysis facilities; adjusting for hospital effects. Lifetime data analysis, 19(4), pp.490-512.
fe.data.prep
, test.fe.prov
,
funnel.SRR
, confint.fe.prov
# Name input variables and other parameters # a small positive number specifying stopping # criterion of Newton-Raphson algorithm tol <- 1e-5 Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) data(hospital_prepared) # build in data set fe.ls <- fe.prov(hospital_prepared, Y.char, Z.char, prov.char, tol) # model fitting
# Name input variables and other parameters # a small positive number specifying stopping # criterion of Newton-Raphson algorithm tol <- 1e-5 Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) data(hospital_prepared) # build in data set fe.ls <- fe.prov(hospital_prepared, Y.char, Z.char, prov.char, tol) # model fitting
funnel.SRR
produces and returns funnel plots for the analysis using discharge-specific
and patient-specific inputs with provider ID. Go to
Github for a tutorial.
funnel.SRR(input.dis, input.prov, target = 1, alphas = c(0.1, 0.05, 0.01), type = "FE.score", sigma.b = NULL)
funnel.SRR(input.dis, input.prov, target = 1, alphas = c(0.1, 0.05, 0.01), type = "FE.score", sigma.b = NULL)
input.dis |
a |
input.prov |
a |
target |
target standardized readmission ratio (SRR) |
alphas |
numeric vector of alpha levels of interest |
type |
string of length one containing the type of test performed. Currently options include "score", "exact", "FE.score", "FE.exact", "FERE.score", "FERE.exact" |
sigma.b |
sigma for random effects. Should only have value other than null
if prefix "FERE." specified
in |
Returns a ggplot
object. Unless stored in a new object,
will be printed automatically.
He, K., Kalbfleisch, J.D., Li, Y. and Li, Y., 2013. Evaluating hospital readmission rates in dialysis facilities; adjusting for hospital effects. Lifetime data analysis, 19(4), pp.490-512.
fe.data.prep
, fe.prov
, test.fe.prov
,
confint.fe.prov
, ggplot2
# Name input variables and other parameters # a small positive number specifying stopping # criterion of Newton-Raphson algorithm tol <- 1e-5 Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) data(hospital_prepared) # build in data set fe.ls <- fe.prov(hospital_prepared, Y.char, Z.char, prov.char, tol) # model fitting # Hypothesis tests null = "median" alpha <- 0.05 # significance level score.fe <- test.fe.prov(hospital_prepared, fe.ls, Y.char, Z.char, prov.char, test="score", null, alpha) # format input data for funnel plot input.dis <- data.frame(ID=hospital_prepared[hospital_prepared$included==1, prov.char], prob=fe.ls$Exp) input.prov <- data.frame(SRR=fe.ls$df.prov$SRR, flag=score.fe$flag) # render funnel plot target <- c(1) alphas = c(0.1, 0.05, 0.01) funnel.SRR(input.dis, input.prov, target, alphas, type="FE.score")
# Name input variables and other parameters # a small positive number specifying stopping # criterion of Newton-Raphson algorithm tol <- 1e-5 Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) data(hospital_prepared) # build in data set fe.ls <- fe.prov(hospital_prepared, Y.char, Z.char, prov.char, tol) # model fitting # Hypothesis tests null = "median" alpha <- 0.05 # significance level score.fe <- test.fe.prov(hospital_prepared, fe.ls, Y.char, Z.char, prov.char, test="score", null, alpha) # format input data for funnel plot input.dis <- data.frame(ID=hospital_prepared[hospital_prepared$included==1, prov.char], prob=fe.ls$Exp) input.prov <- data.frame(SRR=fe.ls$df.prov$SRR, flag=score.fe$flag) # render funnel plot target <- c(1) alphas = c(0.1, 0.05, 0.01) funnel.SRR(input.dis, input.prov, target, alphas, type="FE.score")
A data set containing simulated readmissions data for 500 hospitals with
three continuous covariates. This data needs to be processed with fe.data.prep
.
hospital
hospital
A data.frame
with 24438 rows and 5 variables (columns):
Indicator for readmission; 1=Yes, 0=No; numeric
Provider ID; numeric
Simulated covariate 1, numeric
Simulated covariate 2, numeric
Simulated covariate 3, numeric
A data set containing simulated and processed readmissions data for 500 hospitals with
three continuous covariates. This is the form of the data needed to use fe.prov
.
hospital_prepared
hospital_prepared
A data.frame
with 24438 rows and 8 variables (columns):
Indicator for readmission; 1=Yes, 0=No; numeric
Provider ID; numeric
Simulated covariate 1, numeric
Simulated covariate 2, numeric
Simulated covariate 3, numeric
variable 'included' as an indicator
providers with no readmission within 30 days
providers with all readmissions within 30 days
test.fe.prov
Conducts hypothesis tests for model parameter estimates.
First fit a fe.prov
model object. Go to
Github for a tutorial.
test.fe.prov(data, fe.ls, Y.char, Z.char, prov.char, test = "score", null = "median", alpha = 0.05, n = 10000)
test.fe.prov(data, fe.ls, Y.char, Z.char, prov.char, test = "score", null = "median", alpha = 0.05, n = 10000)
data |
prepared |
fe.ls |
fitted model object (fit using |
Y.char |
Y.char name of the response variable from |
Z.char |
Z.char names of covariates from |
prov.char |
name of provider IDs variable as a character string |
test |
string denoting hypothesis test to be conducted. Currently, options
include "exact.binom", "exact.poisbinom", "exact.bootstrap", "score". The default
is |
null |
use median for null comparison |
alpha |
alpha level for the CIs |
n |
number of bootstrap draws |
Returns a data.frame
of the results of the test for each provider
with attributes:
flag: Either "1" for p<alpha/2, "0" p<=1-alpha/2 and p<alpha/2, or "-1" for neither
p: p-value for the hypothesis test of the model parameter
He, K., Kalbfleisch, J.D., Li, Y. and Li, Y., 2013. Evaluating hospital readmission rates in dialysis facilities; adjusting for hospital effects. Lifetime data analysis, 19(4), pp.490-512.
fe.data.prep
, fe.prov
,
funnel.SRR
, confint.fe.prov
# Name input variables and other parameters # a small positive number specifying stopping # criterion of Newton-Raphson algorithm tol <- 1e-5 Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) data(hospital_prepared) # build in data set fe.ls <- fe.prov(hospital_prepared, Y.char, Z.char, prov.char, tol) # model fitting # Hypothesis tests null = "median" alpha = 0.05 score.fe <- test.fe.prov(hospital_prepared, fe.ls, Y.char, Z.char, prov.char, test="score", null, alpha)
# Name input variables and other parameters # a small positive number specifying stopping # criterion of Newton-Raphson algorithm tol <- 1e-5 Y.char <- 'Y' prov.char <- 'prov.ID' Z.char <- paste0('z', 1:3) data(hospital_prepared) # build in data set fe.ls <- fe.prov(hospital_prepared, Y.char, Z.char, prov.char, tol) # model fitting # Hypothesis tests null = "median" alpha = 0.05 score.fe <- test.fe.prov(hospital_prepared, fe.ls, Y.char, Z.char, prov.char, test="score", null, alpha)