Simulating a logit
Simulations can help us to understand distributions, evaluate our models, and compare study designs. During this exercise, you will simulate a logit distribution. This will allow you to generate data with known parameters. This can be helpful when testing models or comparing study designs (e.g. how many samples do we need to collect?).
Bu egzersiz, kursun bir parçasıdır
Generalized Linear Models in R
Egzersiz talimatları
- Using the
plogis()function, convert0on the logit 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.
Uygulamalı etkileşimli egzersiz
Bu egzersizi bu örnek kodu tamamlayarak deneyin.
# Convert from the logit scale to a probability
p <- ___
# Simulate a logit
__