confidence intervals for line and corresponding normcdf
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear guys,
I am going to get the 95% CIs for the regression line and the corresponding cdf. The code is shown below:
n = 40;
x = 10*rand(n,1);
x = sort(x);
y = 5 + .5*x + randn(n,1);
pos = y>8;
y = min(y,8);
figure(1);plot(x,y,'o');hold on;
The data is censored so I used maximum likelihood estimation to get the values of slope and intercept for the linear regression line. Could somebody tell me how to calculate CIs for this line? I know how to do it when the data is uncensored, but for ecnsored data I am not sure they are using the same method?
Also for uncensored data I know how to get information matrix which will be used in normcdf function. Again, for censored data, I am not sure it is appropriate to use the same method.
Thank you for the help in advance!
David
댓글 수: 0
답변 (1개)
Daniel Shub
2011년 6월 30일
The question is not so clear to me and is outside my area of expertise, but I will give it a stab ...
Have you thought about a bootstrap to get the confidence intervals? Basically instead of getting the slope and intercept once, you do it many times (100+). Each time you give it a slightly different set of x and y. The way the x and y are chosen for each fit is taking your full set of n points (40 in this case) and choosing 40 of them randomly with replacement (that means that point 7 might be chosen 5 times and point 8 might never be chosen). If you have 100 fits, the 2nd lowest and 2nd highest slope give you the 96% confidence interval.
As for the normcdf part, I have no idea what you are talking about.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!