Package 'FEprovideR'

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

Help Index


Compute confidence intervals for fitted model

Description

confint.fe.prov computes the (1-alpha)% confidence intervals for the fixed effect parameter estimates. Go to Github for a tutorial.

Usage

## S3 method for class 'fe.prov'
confint(object, parm = "all", level = 0.95, data,
  Y.char, Z.char, prov.char, ...)

Arguments

object

fitted model object (fit using fe.prov)

parm

provider IDs for which confidence intervals are desired. The default is "all". Specify a subset of privider effects with a numeric vector of provider IDs. For example, parm=c(1,20) for providers 1 and 20.

level

confidence level (default is 0.95)

data

prepared data.frame. Use fe.data.prep to prepare the raw data

Y.char

Y.char name of the response variable from data as a character string

Z.char

Z.char names of covariates from data as vector of character strings

prov.char

name of provider IDs variable as a character string

...

extra arguments to be passed to confint

Value

Returns a data.frame of gamma and SRR lower and upper CI bounds. Each row is a parameter, each column gives a different bound.

References

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.

See Also

fe.data.prep, fe.prov, test.fe.prov, funnel.SRR

Examples

# 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)

Prepares data for model fitting (fe.prov)

Description

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.

Usage

fe.data.prep(data, Y.char, Z.char, prov.char, cutoff = 10)

Arguments

data

a data.frame including response, provider ID, and covariates, with missing values imputed

Y.char

name of the response variable from data as a character string

Z.char

names of covariates from data as vector of character strings

prov.char

name of provider IDs variable as a character string

cutoff

cutoff of provider size as an interger, default value is 10

Value

data.frame: a data frame sorted by provider IDs with additional variables 'included', 'no.readm', 'all.readm' and missing values imputed.

References

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.

See Also

fe.prov, test.fe.prov, funnel.SRR, confint.fe.prov

Examples

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

Fit logistic fixed-effect model with high-dimensional predictors

Description

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.

Usage

fe.prov(data, Y.char, Z.char, prov.char, tol = 1e-05, null = "median")

Arguments

data

prepared data.frame. Use fe.data.prep to prepare the raw data

Y.char

name of the response variable from data as a character string

Z.char

names of covariates from data as vector of character strings

prov.char

name of provider IDs variable as a character string

tol

tolerance level for convergence. Default is 1e-5

null

use median for null comparison

Value

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

References

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.

See Also

fe.data.prep, test.fe.prov, funnel.SRR, confint.fe.prov

Examples

# 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 plot for SRR (standardized readmission ratios)

Description

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.

Usage

funnel.SRR(input.dis, input.prov, target = 1, alphas = c(0.1, 0.05,
  0.01), type = "FE.score", sigma.b = NULL)

Arguments

input.dis

a data.frame consisting of discharge-specific inputs and provider ID

input.prov

a data.frame consisting of provider-specific inputs and provider ID

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 type= argument

Value

Returns a ggplot object. Unless stored in a new object, will be printed automatically.

References

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.

See Also

fe.data.prep, fe.prov, test.fe.prov, confint.fe.prov, ggplot2

Examples

# 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")

Simulated readmissions data for 500 hospitals

Description

A data set containing simulated readmissions data for 500 hospitals with three continuous covariates. This data needs to be processed with fe.data.prep.

Usage

hospital

Format

A data.frame with 24438 rows and 5 variables (columns):

Y

Indicator for readmission; 1=Yes, 0=No; numeric

prov.ID

Provider ID; numeric

z1

Simulated covariate 1, numeric

z2

Simulated covariate 2, numeric

z3

Simulated covariate 3, numeric


Prepared version of simulated readmissions data for 500 hospitals

Description

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.

Usage

hospital_prepared

Format

A data.frame with 24438 rows and 8 variables (columns):

Y

Indicator for readmission; 1=Yes, 0=No; numeric

prov.ID

Provider ID; numeric

z1

Simulated covariate 1, numeric

z2

Simulated covariate 2, numeric

z3

Simulated covariate 3, numeric

included

variable 'included' as an indicator

no.readm

providers with no readmission within 30 days

all.readm

providers with all readmissions within 30 days


Hypothesis tests for fe.prov model object

Description

test.fe.prov Conducts hypothesis tests for model parameter estimates. First fit a fe.prov model object. Go to Github for a tutorial.

Usage

test.fe.prov(data, fe.ls, Y.char, Z.char, prov.char, test = "score",
  null = "median", alpha = 0.05, n = 10000)

Arguments

data

prepared data.frame. Use fe.data.prep

fe.ls

fitted model object (fit using fe.prov)

Y.char

Y.char name of the response variable from data as a character string

Z.char

Z.char names of covariates from data as vector of character strings

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 test="score"

null

use median for null comparison

alpha

alpha level for the CIs

n

number of bootstrap draws

Value

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

References

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.

See Also

fe.data.prep, fe.prov, funnel.SRR, confint.fe.prov

Examples

# 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)