test.linear_fe: Conduct hypothesis testing for provider effects from a fitted...

View source: R/test.linear_fe.R

test.linear_feR Documentation

Conduct hypothesis testing for provider effects from a fitted linear_fe object

Description

Conduct hypothesis tests on provider effects and identify outlying providers for a fixed effect linear model.

Usage

## S3 method for class 'linear_fe'
test(fit, parm, level = 0.95, null = "median", alternative = "two.sided", ...)

Arguments

fit

a model fitted from linear_fe.

parm

specifies a subset of providers for which confidence intervals are to be given. By default, all providers are included. The class of parm should match the class of the provider IDs.

level

the confidence level during the hypothesis test, meaning a significance level of 1 - \text{level}. The default value is 0.95.

null

a character string or a number defining the null hypothesis for the provider effects. The default value is "median". The possible values are:

  • "median": The median of the provider effect estimates (\hat{\gamma}_i).

  • "mean": The weighted average of the provider effect estimates (\hat{\gamma}_i), where the weights correspond to the sample size of each provider.

  • numeric: A user-defined numeric value representing the null hypothesis.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater", or "less".

...

additional arguments that can be passed to the function.

Details

The function identifies outlying providers based on hypothesis test results. For two-sided tests, 1 indicates performance significantly higher than expected, -1 indicates lower, For one-sided tests, 1 (right-tailed) or -1 (left-tailed) flags are used. Providers whose performance falls within the central range are flagged as 0. Outlying providers are determined by the test statistic falling beyond the threshold based on the significance level 1 - \text{level}.

Value

A data frame containing the results of the hypothesis test, with the following columns:

flag

a flagging indicator where 1 means statistically higher than expected and -1 means statistically lower than expected.

p-value

the p-value of the hypothesis test.

stat

the test statistic.

Std.Error

the standard error of the provider effect estimate.

Examples

data(ExampleDataLinear)
outcome <- ExampleDataLinear$Y
covar <- ExampleDataLinear$Z
ID <- ExampleDataLinear$ID
fit_linear <- linear_fe(Y = outcome, Z = covar, ID = ID)
test(fit_linear)


pprof documentation built on April 12, 2025, 1:33 a.m.