Question

In: Statistics and Probability

SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE PROBLEM 1 A study of 400...

SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE

PROBLEM 1

A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients.

PROBLEM 2

Suppose that fasting plasma glucose concentrations (FPG) in some population are normally distributed

with a mean of 90 mg/dl and standard deviation of 5 mg/dl.

(a) Among 1,000 people randomly selected from this population, how many would you expect to have

FPG less than 80 mg/dl?

(b) If you draw 25 people from this population, what is the probability that the sample average is larger

than 92 mg/dl?

(c) If you select 5 people from this population, what is the probability that 4 or more of them have a

FPG larger than 100 mg/dl?

Solutions

Expert Solution

Problem statement: A statistical study is being conducted and for that study we have answer few questions using software "R".

Given:- For a set of glaucoma patients blood pressure and Fasting plasma glucose concentrations (FPG) is measured. Based on this we have to answer few questions in R.

Solution:-

Problem 1:-

R-Code

#Initialize sample mean and sample standard deviations of Blood pressure
#sample mean=m
#sample standard deviation=s
#sample size=n
m <- 140
s <- 25
n <- 400
#calculate the interval limits at 95% and 99%
#error_95=computes limits for 95% range
#error_99=computes limits for 99% range
#left_95 and left_99 sets the lower limit of the interval
#right_95 and right_99 sets the higer limit of the interval
error_95 <- qt(0.975,df=n-1)*s/sqrt(n)
left_95 <- m-error_95
right_95 <- m+error_95
error_99 <- qt(0.995,df=n-1)*s/sqrt(n)
left_99 <- m-error_99
right_99 <- m+error_99
#output the results
print(left_95)
print(right_95)
print(left_99)
print(right_99)

Problem 2:-

R-Code for question (a)

#Intialize the population parameters given in question 2
#Population mean=M
#Population standard deviation is =S
M=90
S=5
#First find the probability of finding patients with fasting plasma glucose concentrations less than 80 from this normal distribution using z-score
Probability_lessthan80 <- pnorm(80, M, S)
#output probability
print(Probability_lessthan80)
#we have to compute out of 1000 people, how many people are expected to have fasting plasma glucose concentrations less than 80
numberofsamples=1000
Expectednumberofpeople_below80=(Probability_lessthan80)*(numberofsamples)
#output answer
print(Expectednumberofpeople_below80)

R-code for question (b)

#Intialize the population parameters given in question 2
#Population mean=M
#Population standard deviation is =S
M=90
S=5
#First find the probability of finding patients with fasting plasma glucose concentrations greater than 92 from this normal distribution using z-score
sample_size=25
Probability_lessthan92 <- pnorm(92, M, S/sqrt(sample_size))

Probability_greaterthan92=1-Probability_lessthan92
#output answer
print(Probability_greaterthan92)

R-code for question (c)

#Intialize the population parameters given in question 2
#Population mean=M
#Population standard deviation is =S
M=90
S=5
#First find the probability of finding patients with fasting plasma glucose concentrations greater than 100 from this normal distribution using z-score
Probability_lessthan100 <- pnorm(100, M, S)
Probability_greaterthan100=1-Probability_lessthan100
#output probability
print(Probability_greaterthan100)
#This probability is a chance of success for binomial distribution asked in the question
success=Probability_greaterthan100
number_people=5
#probability that 4 or more people will have fasting plasma glucose concentrations greater than 100 is
probability_4ormorepeople=dbinom(4,number_people, success)+dbinom(5,number_people, success)
#output answer
print (probability_4ormorepeople)


Related Solutions

SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R. SHOW YOUR CODE AND ANSWERS, USING AN RMD FILE (SHOW ANSWERS IN R MARKDOWN FORWAT WITH CODE AND ANSWERS) PROBLEM 1 A study of 400 glaucoma patients yields a sample mean of 140 mm and a sample standard deviation of 25 mm for the the following summaries for the systolic blood pressure readings. Construct the 95% and 99% confidence intervals for μ, the population average systolic blood pressure for glaucoma patients. PROBLEM 2...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R, POST YOUR CODE: PROBLEM 1. Suppose we have 100...
SOLVE THE FOLLOWING USING STATISTICAL SOFTWARE R, POST YOUR CODE: PROBLEM 1. Suppose we have 100 independent draws from some population distribution whose shape is unknown but where the population mean is 10 and SD is 2.5. Suppose tha tn=100 is sufficiently large that for the sample mean to have an approximately normal distribution. (a) What is the chance that the sample mean is within 0.1 units of the population mean? (b) What is the chance that the sample mean...
How do I even begin to solve this using R statistical software? A random sample of...
How do I even begin to solve this using R statistical software? A random sample of eight pairs of twins was randomly assigned to treatment A or treatment B. The data are given in the following table: Twins 1 2 3 4 5 6 7 8 Treatment A 48.3 44.6 49.7 40.5 54.3 55.6 45.8 35.4 Treatment B 43.5 43.8 53.7 43.9 54.4 54.7 45.2 34.4 What is the p-value of the Wilcoxon signed-rank test? Is there any significant evidence...
Solve following using Program R studio. Please show code and results. Thank you. 1. Assume that...
Solve following using Program R studio. Please show code and results. Thank you. 1. Assume that ? is a random variable follows binomial probability distribution with parameters 15 and 0.25.   a. Simulate 100 binomial pseudorandom numbers from the given distribution (using set.seed(200)) and assign them to vector called binran. b. Calculate ?(? < 8) using cumulative probability function. c. Calculate ?(? = 8) using probability distribution function. d. Calculate the average of simulated data and compare it with the corresponding...
Solve following using Program R studio. Please show code and results. Thank you. 3. Assume that...
Solve following using Program R studio. Please show code and results. Thank you. 3. Assume that ? is a random variable represents lifetime of a certain type of battery which is exponentially distributed with mean 60 hours.   a. Simulate 500 pseudorandom numbers (using set.seed(10)) and assign them to a vector called expran. b. Calculate average of simulated data and compare it with corresponding theoretical value. c. Calculate probability that lifetime is less than 50 hours using cumulative probability function. d....
Using R-Studio please answer the following questions and show your code. 1. Julie buys a take-out...
Using R-Studio please answer the following questions and show your code. 1. Julie buys a take-out coffee from one of two coffee shops on a random basis: Ultimo Coffee and Joe’s Place. This month, she measured the temperature of each cup immediately after purchase, using a cooking thermometer. Sample data is shown below, temperatures are in Fahrenheit. ultimo =  c(171,161,169,179, 171,166,169,178,171, 165,172,172) joes = c(168,165,172, 151,162,158,157,160, 158,160,158,164) State the null and alternative hypothesis in your own words. What type of statistical...
Use R to solve the following problem: A study was carried out to investigate the variation...
Use R to solve the following problem: A study was carried out to investigate the variation of rainbow trout weights in a certain creek. The weights (in kilograms) of 10 randomly selected fish are listed below: 0.78, 0.45, 0.35, 0.76, 0.57, 0.42, 0.33, 0.68, 0.66, 0.42 Assume that the population is approximately normally distributed. Test the hypothesis that the unknown population variance is less than 0.08 kg2 at alpha=0.05. Be sure to list (i) your hypotheses, (ii) test statistic, (iii)...
The following should be performed using R and the R code included in your submission. To...
The following should be performed using R and the R code included in your submission. To obtain first prize in a lottery, you need to correctly choose n different numbers from N and 1 number from 20, known as the supplementary. That is we first draw n numbers from 1:N without replacement and then 1 number from 1:20 in another draw. Suppose n=7 and N=35. Let X be the number of drawn numbers that match your selection, where the supplementary...
1. Basic use of R/R Studio. Solve the following problem in R and print out the...
1. Basic use of R/R Studio. Solve the following problem in R and print out the commands and outputs. (a) Create a vector of the positive odd integers less than 100; Remove the values greater than 60 and less than 80; Find the variance of the remaining set of values (b) What’s the difference in output between the commands 2*1:5 and (2*1):5? Why is there a difference? (c) If you wanted to enter the odd numbers from 1 to 19...
solve using r, include code in your answer (a) Generate 25 variables, each of which consists...
solve using r, include code in your answer (a) Generate 25 variables, each of which consists of 25 random samples from a standard normal. Store these variables in a data frame – call it df.train – and randomly select one variable to be the response – rename it y. (The end result should be a data frame with 25 observations on 25 variables but with no relationships between any of the variables.)Now  Repeat the same steps  to create a test set called...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT