**logistic regression model**

** ** Question 1.

The logistic regression model produced the following table of predictions:

- Find the likelihood of the data (true values) using your predictions.

b. Find the log-likelihood of the data using the probabilities from your predictions.

c. What is the null model prediction? (single prediction for all cases using no predictors)

d. What is the likelihood of the data using the null model.

Question 2.

You’ve collected the runtimes for two different scheduling algorithms. Time to figure out which

one is better using the permutation test!

- If the numbers were randomly split between smpl1 and smpl2, how many such splits are

possible?

b. If the numbers were randomly split between smpl1 and smpl2, what would be the probability

to get obtain the above data?

c. You’ve plotted the histogram of the difference using the permutation test. Explain how would

you make you conclusions using the histogram below.

2. How would you find a p-value?** **

**Solution**

s1= c(70.83,73.44,78.81,90.71)

s2 = c(72.27,69.16,83.81,70.22)

d0 <- mean(s1) – mean(s2)

alls<- c(s1, s2) # combine into one vector

N <- length(alls)

n <- length(s1)

p <- combn(N, n) # generate all combinations of n chosen from N

dmeans<- numeric(dim(p)[2]) # vector to store means

for (i in 1:dim(p)[2]) {

dmeans[i] <- mean(alls[p[, i]]) – mean(alls[-p[, i]])

}

# plot histogram of all possible difference in means with lines indicating

# our original difference

hist(dmeans,col=”blue”,xlab=””,ylab=””,main = “”)

abline(v = d0,lwd=3,col=”red”) #red line

permTS(s1,s2 ,alternative = “greater”, method = “exact.ce”,control = permControl(tsmethod = “abs”))

#look at the p-value

** **