Created
June 20, 2023 15:02
-
-
Save DATAUNIRIO/90a78a9821699d85f8f9cd373cd46104 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p = 0.2 | |
n = 2400 | |
x = rbinom(n, 1, p) | |
x | |
mean(x) | |
sd(x) | |
sqrt(2400) | |
qnorm(0.975) | |
Erro_padrao = sd(x)/sqrt(2400) | |
Erro_padrao | |
Z = qnorm(0.975) | |
Limite_Inferior = mean(x) - qnorm(0.975)*(sd(x)/sqrt(2400)) | |
Limite_Superior = mean(x) + qnorm(0.975)*(sd(x)/sqrt(2400)) | |
Limite_Inferior | |
Limite_Superior | |
# Unirio - projeto maternidade | |
# Simulação de dados | |
p = 0.7 | |
n = 2600 | |
y = rbinom(n, 1, p) | |
y | |
mean(y) | |
Limite_Inferior = mean(y) - qnorm(0.975)*(sd(y)/sqrt(2600)) | |
Limite_Superior = mean(y) + qnorm(0.975)*(sd(y)/sqrt(2600)) | |
#--------------------------------------------------------------- | |
numero_de_caras <- 470:610 | |
plot(numero_de_caras, dbinom(numero_de_caras, size=1000, prob=.541),type='h') | |
# H0: p = 0,5 | |
# H1: p != 0,5 | |
# alpha: 0,05 (IC de 95%) | |
prop.test(541,1000) | |
# numero de caras: 7 | |
# em 10 lançamentos | |
#Essa moeda é honesta | |
#H0: p = 0,5 | |
#H1: p != 0,5 | |
#alpha: 0,05 | |
prop.test(7,10) | |
65 caras | |
100 lançamentos de uma moeda | |
#H0: p = 0,5 | |
#H1: p != 0,5 | |
#alpha: 0,05 | |
prop.test(65,100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment