Kom igångKom igång gratis

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.

Den här övningen är en del av kursen

Generalized Linear Models in R

Visa kurs

Övningsinstruktioner

  • Using function pnorm() to convert 0 on the probit scale to a probability. Save the output as p.
  • Using the rbinom function, generate 10 samples (n = 10) with a size of 1 (size = 1) using the probability p.

Interaktiv övning med praktiskt arbete

Testa den här övningen genom att slutföra den här exempelkoden.

# Convert from the probit scale to a probability
p <- ___

# Simulate a probit
___
Redigera och kör kod