RAssignment4:DueDate:2017Oct.201.a.Generatearandomsampleof100numbersfromanormaldistributionwithmean5andstandarddeviation2.b.Plotahistogramofthem.y-rnorm(100,mean=5,sd=2)y[1]7.68585968.39270823.80041946.66164074.87777865.2049658[7]3.05575585.98882542.23869427.85691915.75854517.5400075[13]5.21790992.993809510.71814129.63303928.51274444.0591915[19]7.29745342.26544963.48919458.06875438.09805683.0986778[25]3.72020976.33901687.11736805.20228000.814974010.1983779[31]7.17775636.06885378.06361422.87403526.47419346.4335786[37]10.47589403.44068118.00033433.08719682.09175273.2863925[43]2.94443085.63727704.47992774.82017554.99335126.2177472[49]7.68855405.37891352.09231895.16598027.76934264.6924995[55]9.36507567.02442675.03621895.26265397.23787193.7688262[61]4.68752153.40100883.99195194.25457030.94087282.9630487RAssignment4:DueDate:2017Oct.20[67]5.17892423.97462866.52734597.35739212.49919914.8203938[73]1.20022917.58586294.28938147.74375728.49227295.4304218[79]6.59286594.12265031.34590568.00711953.19152597.3758033[85]1.70566373.98927681.64463484.02109824.74403434.1437217[91]2.22396585.80054328.10238992.22088497.79978522.5713329[97]4.36561934.47178794.38066274.0914253hist(y,col=lightblue)2.Simulateatrailwhichrollsa“die”50times.Howmanytimesdoyousee“3”?x=sample(6,50,replace=TRUE)length(which(x==3))[1]113.Calculatetheprobabilityforeachofthefollowingevents:a.Anormallydistributedvariablewithmean35andstandarddeviation6islargerthan42.b.Getting7outof10successesinabinomialdistributionwithprobability0.8.r-pnorm(42,mean=35,sd=6)r[1]0.87832751-r[1]0.1216725p-dbinom(7,10,0.8)p[1]0.20132664.ThedatafileReal-Estate.txtcontainsinformationonthehomessoldintheDenverareaduringtheyear2003.Thevariablesinthisdatafileareasfollows:RAssignment4:DueDate:2017Oct.20PriceSellingpricein$1000BedroomsNumberofbedroomsSizeSizeofthehomeinsquarefeetPoolSwimmingPool(1=yes,0=no)DistanceDistancefromthehometothecenterofthecityTownshipTownshipNo.GarageGarageattached(1=yes,0=no)BathsNumberofbathroomsa)ReaddataintoR.setwd(D:\\R\\data)data-read.table(Real-Estate.txt,header=TRUE,as.is=TRUE)datab)Developa95percentconfidenceintervalforthemeansellingpriceofthehomes.n-length(data$Price)u-mean(data$Price)alpha-1-0.95se-sd(data$Price)/sqrt(n)z-qnorm(1-alpha/2,n)z-qnorm(1-alpha/2)c1-u+c(-z*se,z*se)c1[1]212.0929230.1128c)Developa98percentconfidenceintervalforthemeandistancethehomeisfromthecenterofthecity.n-length(data$Distance)u-mean(data$Distance)alpha-1-0.98se-sd(data$Distance)/sqrt(n)z-qnorm(1-alpha/2)c2-u+c(-z*se,z*se)c2[1]13.5220615.73509RAssignment4:DueDate:2017Oct.20d)Developa90percentconfidenceintervalfortheproportionofhomeswithanattachedgarage.length(which(data$Garage==1))[1]71n-105p-71/105mp-qnorm(1-(1-0.90)/2)*sqrt(p*(1-p)/n)c3-p+c(-mp,mp)c3[1]0.60107800.7513029e)ArecentarticleintheDenverPostindicatedthatthemeansellingpriceofthehomesintheareaismorethan$220,000.CanweconcludethatthemeansellingpriceinDenverismorethan$220,000?Usethe0.01significancelevel.Whatisthep-value.t.test(data$Price,alternative=greater,mu=220,conf.level=0.99)OneSamplet-testdata:data$Pricet=0.23991,df=104,p-value=0.4054alternativehypothesis:truemeanisgreaterthan22099percentconfidenceinterval:210.2413Infsampleestimates:meanofx221.1029f)Determinetheproportionofhomesthathaveanattachedgarage.Atthe0.05significancelevelcanweconcludethatmorethan60percentofthehomessoldintheDenverareahadanattachedgarage?Whatisthep-value.prop.test(71,105,0.6,alternative=greater)1-sampleproportionstestwithcontinuitycorrectiondata:71outof105,nullprobability0.6X-squared=2.2321,df=1,p-value=0.06758alternativehypothesis:truepisgreaterthan0.695percentconfidenceinterval:0.5925551.000000sampleestimates:pRAssignment4:DueDate:2017Oct.200.6761905