Simulating a probit
During the previous exercise, you simulated a logit. During this exercise, you will simulate a probit. First, you will convert from the probit scale to a probability. Second, you will use this probability to simulate from a binomial distribution.
Questo esercizio fa parte del corso
Generalized Linear Models in R
Istruzioni dell'esercizio
- Using function
pnorm()to convert0on the probit scale to a probability. Save the output asp. - Using the
rbinomfunction, generate 10 samples (n = 10) with a size of 1 (size = 1) using the probabilityp.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# Convert from the probit scale to a probability
p <- ___
# Simulate a probit
___