coefCI
Confidence intervals of coefficient estimates for censored linear regression model
Since R2025a
Description
Examples
Load the readmissiontimes sample data.
load readmissiontimesThe variables Age, Weight, Smoker, and ReadmissionTime contain data for patient age, weight, smoking status, and time of readmission. The Censored variable contains censoring information for ReadmissionTime.
Save Age, Weight, Smoker, and ReadmissionTime in a table, and fit a censored linear regression model to the data.
tbl = table(Age,Weight,Smoker,ReadmissionTime); mdl = fitlmcens(tbl,Censoring=Censored);
View the names of the coefficients.
mdl.CoefficientNames
ans = 1×4 cell
{'(Intercept)'} {'Age'} {'Weight'} {'Smoker'}
Calculate the confidence intervals for the model coefficients.
ci = coefCI(mdl)
ci = 4×2
20.9887 34.4918
-0.1716 0.0647
-0.1444 -0.0776
-4.1938 -0.4971
Load the readmissiontimes sample data.
load readmissiontimesThe variables Age, Weight, Smoker, and ReadmissionTime contain data for patient age, weight, smoking status, and time of readmission. The Censored variable contains censoring information for ReadmissionTime.
Save Age, Weight, Smoker, and ReadmissionTime in a table, and fit a censored linear regression model to the data.
tbl = table(Age,Weight,Smoker,ReadmissionTime); mdl = fitlmcens(tbl,Censoring=Censored);
Find the 99% confidence intervals for the coefficients.
ci = coefCI(mdl,.01)
ci = 4×2
18.8009 36.6796
-0.2099 0.1030
-0.1552 -0.0668
-4.7928 0.1019
The confidence intervals are wider than the default 95% confidence intervals in the example Find Confidence Intervals for Model Coefficients.
Input Arguments
Censored linear regression model, specified as a CensoredLinearModel object
created using fitlmcens,
or a CompactCensoredLinearModel object created using
fitlmcens and compact.
Significance level for the confidence interval,s specified as a numeric value in the
range [0,1]. The confidence level of ci is equal to 100(1 – alpha)%. alpha is the probability that the confidence
intervals do not contain the true value.
Example: 0.01
Data Types: single | double
Output Arguments
Confidence intervals, returned as a k-by-2 numeric matrix, where
k is the number of coefficients. The jth row
of ci is the confidence interval of the jth
coefficient of mdl. The name of coefficient j is
stored in the CoefficientNames property of
mdl.
Data Types: single | double
More About
The coefficient confidence intervals provide a measure of precision for regression coefficient estimates.
A 100(1 – α)% confidence interval gives the range for the corresponding regression coefficient with 100(1 – α)% confidence, meaning that 100(1 – α)% of the intervals resulting from repeated experimentation will contain the true value of the coefficient.
The software finds confidence intervals using the Wald method. The 100(1 – α)% confidence intervals for regression coefficients are
where bi is the coefficient estimate, SE(bi) is the standard error of the coefficient estimate, and t(1–α/2,n–p) is the 100(1 – α/2) percentile of the t-distribution with n – p degrees of freedom. n is the number of observations and p is the number of regression coefficients.
Version History
Introduced in R2025a
See Also
fitlmcens | CensoredLinearModel | CompactCensoredLinearModel | coefTest
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)