Please review project 1. It has been done by you guys and came out with errors. The professor has given her feedback. Kindly please send me a quote for the portfolio. Please note the portfolio should be done based on the work on project 1 and 2.
Thank you.
Project 1 ## Part 1 (Confidence Intervals) # Given summary results are xbar = 19.7 # Mean s = 11.6 # Sample standard deviation n = 48 # Sample size # ---x---x---x--- A --- x---x---x--- # A. A point estimate for the average is given by the sample mean xbar. # Answer: xbar = 19.7 (point estimate) # ---x---x---x--- B --- x---x---x--- # Calculate 80, 85, 90, 95 percent confidence intervals # Calculating error se = s/ sqrt(n) # Calculating 80% confidence intervals alpha <- 0.2="" margin.error_80="">-><- qnorm(1="" -="" (alpha/2))="" *="" se="" margin.error_80="" #="" lower="" ci="" lower.bound_80="">-><- xbar="" -="" margin.error_80="" lower.bound_80="" #="" upper="" ci="" upper.bound_80="">-><- xbar="" +="" margin.error_80="" upper.bound_80="" #="" calculating="" 85%="" confidence="" intervals="" alpha="">-><- 0.15="" margin.error_85="">-><- qnorm(1="" -="" (alpha/2))="" *="" se="" margin.error_85="" #="" lower="" ci="" lower.bound_85="">-><- xbar="" -="" margin.error_85="" lower.bound_85="" #="" upper="" ci="" upper.bound_85="">-><- xbar="" +="" margin.error_85="" upper.bound_85="" #="" calculating="" 90%="" confidence="" intervals="" alpha="">-><- 0.1="" margin.error_90="">-><- qnorm(1="" -="" (alpha/2))="" *="" se="" margin.error_90="" #="" lower="" ci="" lower.bound_90="">-><- xbar="" -="" margin.error_90="" lower.bound_90="" #="" upper="" ci="" upper.bound_90="">-><- xbar="" +="" margin.error_90="" upper.bound_90="" #="" calculating="" 95%="" confidence="" intervals="" alpha="">-><- 0.05="" margin.error_95="">-><- qnorm(1="" -="" (alpha/2))="" *="" se="" margin.error_95="" #="" lower="" ci="" lower.bound_95="">-><- xbar="" -="" margin.error_95="" lower.bound_95="" #="" upper="" ci="" upper.bound_95="">-><- xbar="" +="" margin.error_95="" upper.bound_95="" #="" taking="" together="" lower="" and="" upper="" limits="" lowerlimit="">-><- c(lower.bound_80,lower.bound_85,lower.bound_90,lower.bound_95)="" upperlimt="">-><- c(upper.bound_80,upper.bound_85,upper.bound_90,upper.bound_95)="" #="" creating="" a="" dataframe="" with="" 80,85,90,95%="" confidence="" intervals="" confidents="">-><- data.frame(lowerlimit,upperlimt,="" mean="xbar)" confidents="" #="" ---x---x---x---="" c="" ---="" x---x---x---="" #="" making="" confidence="" intervals="" plot="" plot(y="confidents" $="" mean="" ,="" x="factor(c(80,85,90,95))," ylab="Mean" ,="" xlab="Confidence Intervals" ,="" main="Confidence Intervals Plot" )="" #="" adding="" confidence="" intervals="" plotrix::plotci(confidents$mean,="" y="NULL," uiw="confidents$upperlimt" -="" confidents$mean,="" liw="confidents$Mean" -="" confidents$lowerlimit,="" pch="5," slty="5," scol="black" ,="" col='red' ,="" err='y' ,="" add="TRUE)" #="" interpretation="" :="" by="" increasing="" the="" confidence="" the="" range="" of="" the="" interval="" is="" increasing="" #="" that="" is="" if="" we="" are="" less="" confidence="" then="" we="" will="" suggest="" high="" range="" of="" the="" statistic.="" #="" ---x---x---x---="" d="" ---="" x---x---x---="" #conditions:="" the="" conditions="" are="" random="" sampling="" and="" normal="" distribution="" #="" because="" it="" need="" to="" be="" satisfy="" the="" normal="" distribution="" bys="" using="" the="" #="" central="" limit="" theorem="" sample="" mean's="" distributions="" follows="" normal.="" ##="" part="" 2="" (test="" of="" mean)="" mu="">-><- 20="" #="" ---x---x---x---="" a="" ---="" x---x---x---="" z_table="">-><- round(qnorm(1-c(0.01/2)),2)="" z_table="" #="" answer:="" the="" rejection="" region="" is="" to="" test="" statistic="" is="" z="">2.58. # That is if z > 2.58, we reject Null Hypothesis # ---x---x---x--- B --- x---x---x--- # Calculating the test statistic z_cal <- ((xbar="" -="" mu)/(s/sqrt(n)))="" z_cal="" #="" ---x---x---x---="" c="" ---="" x---x---x---="" #="" conclusion="" :="" here="" z_cal="" value="" is="" less="" than="" z_table="" value="" so,="" #="" we="" accept="" the="" null="" hypothesis="" #="" ---x---x---x---="" d="" ---="" x---x---x---="" pnorm(q="-0.1791777," lower.tail="TRUE)" #="" ---x---x---x---="" ---="" x---x---x---="" #="" conclusion="" :="" here="" p-value="" is="" less="" than="" 0.05="" so,="" #="" we="" accept="" the="" null="" hypothesis="" ##="" part="" 3="" (power="" of="" a="" test="" )="" #="" given="" that="" n="48" xbar="19.7" s="11.6" #="" ---x---x---x---="" a="" ---="" x---x---x---="" true_mu="19" error="">-><- qnorm(0.975)*s/sqrt(n)="" left="">-><- xbar-error="" right="">-><- xbar+error="" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu) (s/sqrt(n))="" p="">-(right-true_mu)><- pnorm(zright)-pnorm(zleft)="" p="" #="" type="" ii="" error="" 1-p="" #="" ---x---x---x---="" b="" ---="" x---x---x---="" true_mu="18" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu) (s/sqrt(n))="" p="">-(right-true_mu)><- pnorm(zright)-pnorm(zleft)="" p="" #="" type="" ii="" error="" 1-p="" true_mu="16" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu) (s/sqrt(n))="" p="">-(right-true_mu)><- pnorm(zright)-pnorm(zleft)="" p="" #="" type="" ii="" error="" 1-p="" true_mu="14" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu) (s/sqrt(n))="" p="">-(right-true_mu)><- pnorm(zright)-pnorm(zleft)="" p="" #="" type="" ii="" error="" 1-p="" true_mu="12" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu) (s/sqrt(n))="" p="">-(right-true_mu)><- pnorm(zright)-pnorm(zleft)="" p="" #="" type="" ii="" error="" 1-p="" #="" ---x---x---x---="" c="" ---="" x---x---x---="" #="" plotting="" the="" power="" test="" value="" vs="" alternative="" means="" y="c(0.07," 0.17,="" 0.598,="" 0.93,="" 0.996)="" x="c(19," 18,="" 16,="" 14,="" 12)="" plot(x,y,type="b" )="" #="" ---x---x---x---="" d="" ---="" x---x---x---="" #="" from="" the="" part="" c),="" power="" value="" is="" 0.8="" true_mu="15" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu) (s/sqrt(n))="" p="">-(right-true_mu)><- pnorm(zright)-pnorm(zleft)="" p="" #="" type="" ii="" error="" 1-p="" #="" ---x---x---x---="" e="" ---="" x---x---x---="" #="" answer:="" the="" probability="" that="" to="" reject="" null="" hypothesis="" is="" 0.2="" i.e="" p="0.2" ##="" part="" 4="" (test="" of="" variance)="" n="48" s="11.6" xbar="19.7" sigma2="">-><- 100="" #="" ---x---x---x---="" a="" ---="" x---x---x---="" xcri="">-><- qchisq(p=".01," df="48-1)" xcri="" #="" ---x---x---x---="" b="" ---="" x---x---x---="" xcal="">-><- ((n-1)="" *="" (11.6="" ^="" 2))/sigma2="" xcal="" #="" ---x---x---x---="" c="" ---="" x---x---x---="" #="" conclusion="" :="" here="" xcal="" value="" is="" greater="" than="" xcri="" value="" so,="" #="" we="" reject="" the="" null="" hypothesis="" i.e="" accept="" the="" alternative="" hypothesis.="" solution-code.r="" dell="" 2021-03-10="" ##="" part="" 1="" (confidence="" intervals)="" #="" given="" summary="" results="" are="" xbar="19.7" #="" mean="" s="11.6" #="" sample="" standard="" deviation="" n="48" #="" sample="" size="" #="" ---x---x---x---="" a="" ---="" x---x---x---="" #="" a.="" a="" point="" estimate="" for="" the="" average="" is="" given="" by="" the="" sample="" mean="" xbar.="" #="" answer:="" xbar="19.7" (point="" estimate)="" #="" ---x---x---x---="" b="" ---="" x---x---x---="" #="" calculate="" 80,="" 85,="" 90,="" 95="" percent="" confidence="" intervals="" #="" calculating="" error="" se="s/" sqrt(n)="" #="" calculating="" 80%="" confidence="" intervals="" alpha="">-><- 0.2="" margin.error_80="">-><- qnorm(1="" -="" (alpha/2))="" *="" se="" margin.error_80="" ##="" [1]="" 2.145722="" #="" lower="" ci="" lower.bound_80="">-><- xbar="" -="" margin.error_80="" lower.bound_80="" ##="" [1]="" 17.55428="" #="" upper="" ci="" upper.bound_80="">-><- xbar="" +="" margin.error_80="" upper.bound_80="" ##="" [1]="" 21.84572="" #="" calculating="" 85%="" confidence="" intervals="" alpha="">-><- 0.15="" margin.error_85="">-><- qnorm(1="" -="" (alpha/2))="" *="" se="" margin.error_85="" ##="" [1]="" 2.41023="" #="" lower="" ci="" lower.bound_85="">-><- xbar="" -="" margin.error_85="" lower.bound_85="" ##="" [1]="" 17.28977="" #="" upper="" ci="" upper.bound_85="">-><- xbar="" +="" margin.error_85="" upper.bound_85="" ##="" [1]="" 22.11023="" #="" calculating="" 90%="" confidence="" intervals="" alpha="">-><- 0.1="" margin.error_90="">-><- qnorm(1="" -="" (alpha/2))="" *="" se="" margin.error_90="" ##="" [1]="" 2.754004="" #="" lower="" ci="" lower.bound_90="">-><- xbar="" -="" margin.error_90="" lower.bound_90="" ##="" [1]="" 16.946="" #="" upper="" ci="" upper.bound_90="">-><- xbar="" +="" margin.error_90="" upper.bound_90="" ##="" [1]="" 22.454="" #="" calculating="" 95%="" confidence="" intervals="" alpha="">-><- 0.05="" margin.error_95="">-><- qnorm(1="" -="" (alpha/2))="" *="" se="" margin.error_95="" ##="" [1]="" 3.281599="" #="" lower="" ci="" lower.bound_95="">-><- xbar="" -="" margin.error_95="" lower.bound_95="" ##="" [1]="" 16.4184="" #="" upper="" ci="" upper.bound_95="">-><- xbar="" +="" margin.error_95="" upper.bound_95="" ##="" [1]="" 22.9816="" #="" taking="" together="" lower="" and="" upper="" limits="" lowerlimit="">-><- c(lower.bound_80,lower.bound_85,lower.bound_90,lower.bound_95)="" upperlimt="">-><- c(upper.bound_80,upper.bound_85,upper.bound_90,upper.bound_95)="" #="" creating="" a="" dataframe="" with="" 80,85,90,95%="" confidence="" intervals="" confidents="">-><- data.frame(lowerlimit,upperlimt,="" mean="xbar)" confidents="" ##="" lowerlimit="" upperlimt="" mean="" ##="" 1="" 17.55428="" 21.84572="" 19.7="" ##="" 2="" 17.28977="" 22.11023="" 19.7="" ##="" 3="" 16.94600="" 22.45400="" 19.7="" ##="" 4="" 16.41840="" 22.98160="" 19.7="" #="" ---x---x---x---="" c="" ---="" x---x---x---="" #="" making="" confidence="" intervals="" plot="" plot(y="confidents" $="" mean="" ,="" x="factor(c(80,85,90,95))," ylab="Mean" ,="" xlab="Confidence Intervals" ,="" main="Confidence Intervals Plot" )="" #="" adding="" confidence="" intervals="" plotrix::plotci(confidents$mean,="" y="NULL," uiw="confidents$upperlimt" -="" confidents$mean,="" liw="confidents$Mean" -="" confidents$lowerlimit,="" pch="5," slty="5," scol="black" ,="" col='red' ,="" err='y' ,="" add="TRUE)" #="" interpretation="" :="" by="" increasing="" the="" confidence="" the="" range="" of="" the="" interval="" is="" increasing="" #="" that="" is="" if="" we="" are="" less="" confidence="" then="" we="" will="" suggest="" high="" range="" of="" the="" statistic.="" #="" ---x---x---x---="" d="" ---="" x---x---x---="" #conditions:="" the="" conditions="" are="" random="" sampling="" and="" normal="" distribution="" #="" because="" it="" need="" to="" be="" satisfy="" the="" normal="" distribution="" bys="" using="" the="" #="" central="" limit="" theorem="" sample="" mean's="" distributions="" follows="" normal.="" ##="" part="" 2="" (test="" of="" mean)="" mu="">-><- 20="" #="" ---x---x---x---="" a="" ---="" x---x---x---="" z_table="">-><- round(qnorm(1-c(0.01/2)),2)="" z_table="" ##="" [1]="" 2.58="" #="" answer:="" the="" rejection="" region="" is="" to="" test="" statistic="" is="" z="">2.58. # That is if z > 2.58, we reject Null Hypothesis # ---x---x---x--- B --- x---x---x--- # Calculating the test statistic z_cal <- ((xbar="" -="" mu)/(s/sqrt(n)))="" z_cal="" ##="" [1]="" -0.1791777="" #="" ---x---x---x---="" c="" ---="" x---x---x---="" #="" conclusion="" :="" here="" z_cal="" value="" is="" less="" than="" z_table="" value="" so,="" #="" we="" accept="" the="" null="" hypothesis="" #="" ---x---x---x---="" d="" ---="" x---x---x---="" pnorm(q="-0.1791777," lower.tail="TRUE)" ##="" [1]="" 0.4288991="" #="" ---x---x---x---="" ---="" x---x---x---="" #="" conclusion="" :="" here="" p-value="" is="" less="" than="" 0.05="" so,="" #="" we="" accept="" the="" null="" hypothesis="" ##="" part="" 3="" (power="" of="" a="" test="" )="" #="" given="" that="" n="48" xbar="19.7" s="11.6" #="" ---x---x---x---="" a="" ---="" x---x---x---="" true_mu="19" error="">-><- qnorm(0.975)*s/sqrt(n)="" left="">-><- xbar-error="" right="">-><- xbar+error="" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu) (s/sqrt(n))="" p="">-(right-true_mu)><- pnorm(zright)-pnorm(zleft)="" p="" ##="" [1]="" 0.9297466="" #="" type="" ii="" error="" 1-p="" ##="" [1]="" 0.07025339="" #="" ---x---x---x---="" b="" ---="" x---x---x---="" true_mu="18" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu) (s/sqrt(n))="" p="">-(right-true_mu)><- pnorm(zright)-pnorm(zleft)="" p="" ##="" [1]="" 0.826111="" #="" type="" ii="" error="" 1-p="" ##="" [1]="" 0.173889="" true_mu="16" zleft="">-><- (left-true_mu)/(s/sqrt(n))="" zright="">-><-(right-true_mu)/(s/sqrt(n))>-(right-true_mu)/(s/sqrt(n))>->->