Question

In: Statistics and Probability

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

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

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.

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)


Please up vote the solution if it helpful......Thank you


Related Solutions

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...
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....
APPLIED STATISTICS 2 USE R CODE! SHOW R CODE Use data file RecordMath2526.txt, to produce a...
APPLIED STATISTICS 2 USE R CODE! SHOW R CODE Use data file RecordMath2526.txt, to produce a plot graph with Exam1 as x, Exam2 as y, use Gender as color, and Hw1 as pch. RecordMath2526 information Index Gender Hw1 Hw2 Hw3 Exam1 Hw4 Exam2 Hw5 Hw6 Hw7 Final 1 F 9 6 8 60 7 82 10 10 9 69 2 M 10 10 10 94 9 98 10 10 8 91 3 M 9 10 8 79 9 55 10...
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...
Please solve all of the question using R and do clarify the answers. Using the (SATGPA)...
Please solve all of the question using R and do clarify the answers. Using the (SATGPA) data set in (Stat2Data) package. Test by using ?= .01. 1) Create the following three variables and then print out all the six variables. A) Create new variable "SAT", which is the sum of (MathSAT) and (VerbalSAT). B) Create second new variable ("SATLevel"), and assign the value of( "SATLevel") as 1 when SAT<=1100, 2 when 1100<SAT<=1200, 3 when 1200<SAT<=1300, and 4 when SAT>1300. C)Create...
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...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT