0
$\begingroup$

I'm trying to implement a bootstrap method to obtain confidences intervals of a fitted logistic curve.

I've been learning a lot because I'm new to these things, so I ask forgiveness if the question is too broad or if it's too simple.

the setup is the following: For each fixed X values, there are 10 different answers Y given, that can only be 0 or 1. From these answers a performance is calculated in the following way: before a certain X the correct answer is 0, and after is 1.

The performance ranges from 0 to 1, and it's fitted with a logistic function.

Now, I need to compare different fitting for different setups, for this reason I'm trying to implement a bootstrap method (after failing to implement it using matlab functions), but I am not sure if the result I get follows a procedure that is statistically correct.

The procedure I did is the following: I generated 20.000 random set of performances (that will generate different fit), keeping X constant, but random sampling Y with replacement.

For example, having associated to X the following "real" answers:

X(1) => Y_real(1) = [0 0 0 0 0 1 0 0 0 0]
...
X(n) => Y_real(n) = [1 1 1 1 1 0 1 1 1 0]

I generate (20000 times separately)

X(1) => Y_2(1) = [ ... ]
...
X(n) => Y_2(n) = [ ... ]

where for each Y_2(n) I sample from Y_real(n), with repetition (function randsample of matlab)

Obtaining in the end a matrix of:

number of X * 10 (number of answers) * 20000

From this I obtain 20000 different fits, and I use them to obtain confidences and compare different setups (so e.g. meanA(20000) vs meanB(20000), where A and B are different initial setups, that generated different data).

Is the procedure correct? Should I be using a different method?

Additional info:

  1. the performance should be a probability
  2. the curve is fit using glmfit .. 'binomial','link','logit'

Many thanks in advance, I hope I was clear enough.

$\endgroup$
  • $\begingroup$ Sorry, I am confused by the statement: "For each fixed X values, there are 10 different answers Y given, that can only be 0 or 1*" so is $Y$ consider multinomial then? $\endgroup$ – usεr11852 says Reinstate Monic Oct 26 '19 at 23:07
  • $\begingroup$ Sorry for the confusion, no, I mean that each X (a question) is repeated 10 times. The answer can only be 0 or 1. $\endgroup$ – drdud Oct 28 '19 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.