glmfit with multivariant('binomial','link','probit')
Show older comments
Somebody helped me with a code about probit regression to test whether one factor may affect the mu and threshold between two curves,but I don't quite understand some details about the code. Here is one example:
X1=[-8 -3.2 -1.28 -0.51 0 0.51 1.28 3.20 8 -8 -3.2 -1.28 -0.51 0 0.51 1.28 3.20 8];
X2=[0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1];
Y1=[0 0 3 4 5 7 9 10 10 0 4 3 7 6 8 10 9 10];
Y2=[10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10]
[b, dev, stats] = glmfit([ X1 X2 X1.* X2],[Y1 Y2],'binomial','link','probit');
%Case I
bias(1)= (norminv(0.5)-b(1))/b(2);% 50 pct PD threshold
threshold(1) = abs( norminv(0.84)/b(2) ); % 84% gaussian threshold
%Case2 bias(2) = (norminv(0.5)-(b(1) + b(3)))/(b(2) + b(4)); threshold(2) = abs( norminv(0.84)/(b(2)+b(4)) ); % p value P_bias = stats.p(3); % P value for bias P_slope = stats.p(4); % P value for threshold
I don't quite understand why bias(1),threshold(1),bias(2),threshold(2) can be formulated like that?And why stats.p(3) and stats.p(4) can imply the bias and threshold difference between two factors?
Answers (0)
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!