linear_fe
objectConduct hypothesis tests on provider effects and identify outlying providers for a fixed effect linear model.
# S3 method for linear_fe
test(fit, parm, level = 0.95, null = "median", alternative = "two.sided", ...)
A data frame containing the results of the hypothesis test, with the following columns:
a flagging indicator where 1
means statistically higher than expected
and -1
means statistically lower than expected.
the p-value of the hypothesis test.
the test statistic.
the standard error of the provider effect estimate.
a model fitted from linear_fe
.
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.
the confidence level during the hypothesis test, meaning a significance level of \(1 - \text{level}\). The default value is 0.95.
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.
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.
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}\).
data(ExampleDataLinear)
outcome <- ExampleDataLinear$Y
covar <- ExampleDataLinear$Z
ProvID <- ExampleDataLinear$ProvID
fit_linear <- linear_fe(Y = outcome, Z = covar, ProvID = ProvID)
test(fit_linear)
Run the code above in your browser using DataLab