Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 4.a (5 points) Assume each researcher uses the null model that their sample is a sample from a binomial distribution with the size parameter
Question 4.a (5 points) Assume each researcher uses the null model that their sample is a sample from a binomial distribution with the size parameter equal to the number of items in the sample and the parameter giving the probability success equal to the value pr. One way to dene a p-value for this null hypothesis is to calculate the twice probability of a value less than or equal to the observed number of successes under the null hypothesis, to calculate twice the probability of a value greater than or equal to the observed number of successes under the null hypothesis, and to take the smaller of these to be the p-value. Please complete the function template below to make a p-value calculator for the researchers. Thle function should return the p-value of this test of the null hypothesis if the argument \"obs\" is the observed number of successes, the parameter "size\" is the sample size, and the parameter \"pr\" is the probability of success under the null hypothesis. For iture use, you may wish to implement this so that, given a vector of observations, the inction returns a vector of the corresponding p-values. Please apply your function to the case of an observation of 25 successes in a sample of size 100 with hypothesized probability of success equal to .3 and to an observation of 30 successes in a sample of size 100 with hypothesized probability of success equal to .3 # p-vatue caLcuLator p.get
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started