BME 530 Assignment 3 Using R to complete all assignments if applicable. Q1 (3pts). Blood Types. The prevalence of blood types in the US population is O+: 37.4%, A+: 35.7%, B+: 8.5%, AB+: 3.4%, O–:...

1 answer below »
R hw


BME 530 Assignment 3 Using R to complete all assignments if applicable. Q1 (3pts). Blood Types. The prevalence of blood types in the US population is O+: 37.4%, A+: 35.7%, B+: 8.5%, AB+: 3.4%, O–: 6.6%, A–: 6.3%, B–: 1.5%, and AB–: 0.6%. 1) A sample of 24 subjects is randomly selected from the US population. What is the probability that 8 subjects are A+. Random variable X describes the number of A+ subjects among 24 selected. Find E(X) and Var (X). 2) Find the probability that among 500 randomly selected subjects, the number of B– subjects is at least 2. 3) Use the Poisson approximation to calculate the probability in 2). Q2 (4pts). 1) Let X be a random variable with the following probability distribution: x -3 6 9 f(x) 1/6 1/2 1/3 Find E(g(x)) and var(g(x)), where g(X) = (2X + 1)2. 2) The density function of a random variable X is ?(?) = { 2(? + 2) 5 , 0 <>< 1 0, ??ℎ?????? find e(x) and var(x). q3 (3pts). leptin (from the greek word leptos, meaning thin) is a 16-kda protein hormone that plays a crucial role in regulating energy intake and energy expenditure, including the regulation (decrease) of appetite and (increase) of metabolism. serum leptin concentrations can be measured in several ways. one approach uses a radioimmunoassay in venous blood samples (linco research inc., st charles, mo). several studies have consistently found women to have higher serum leptin concentrations than do men. for example, among us adults across a broad age range, the mean serum leptin concentration in women is approximately normal ?(12.7??/?, (1.3??/?)2) and in men approximately normal ?(4.6??/?, (0.5??/?)2). 1) what is the probability that leptin concentration in a randomly selected us adult male exceeds 6 ??/?? 2) what proportion of us women have the concentration of leptin in the interval 12.7 ± 2??/?? 3) what interval, symmetric about the mean 12.7??/?, contains leptin concentrations of 95% of adult us women? q4 (5pts). take a sample of size n=10 from the poisson distribution with mean ?=3 and compute the sample mean. repeat this procedure 10,000 times and plot the histogram of sample means. then repeat this procedure for n=100, 1000. is there any trend observed in the histogram of the sample mean as n increases? what is the property of the sampling distribution of the sample mean for n=1000? what are the mean and variance of this distribution? q5 (5pts). use the data in hw1 to make the following statistical inferences about the following attributes in a general heart disease population where the data were generated. 1) construct the 95% confidence intervals for average creatinine phosphokinase (cpk) levels in deceased and alive patients in the population, respectively. 2) construct the 95% confidence intervals for variances of cpk levels in deceased and alive patients in the population, respectively. 3) construct the 95% confidence intervals for proportions of diabetes in deceased and alive patients in the population, respectively. justify the sampling distributions used for the calculation in (1)-(3). you may use the histograms of the cpk levels for 1) and 2). submission. submit a zip file (hw3_name.zip) on blackboard that includes: 1) both r notebook (.rmd) and rendered results (.html). your notebook should include some annotations for the scripts so that a grader knows what the script is for. 2) report document (.pdf) age,anaemia,creatinine_phosphokinase,diabetes,ejection_fraction,high_blood_pressure,platelets,serum_creatinine,serum_sodium,sex,smoking,time,death_event 75,0,582,0,20,1,265000,1.9,130,1,0,4,1 55,0,7861,0,38,0,263358.03,1.1,136,1,0,6,1 65,0,146,0,20,0,162000,1.3,129,1,1,7,1 50,1,111,0,20,0,210000,1.9,137,1,0,7,1 65,1,160,1,20,0,327000,2.7,116,0,0,8,1 90,1,47,0,40,1,204000,2.1,132,1,1,8,1 75,1,246,0,15,0,127000,1.2,137,1,0,10,1 60,1,315,1,60,0,454000,1.1,131,1,1,10,1 65,0,157,0,65,0,263358.03,1.5,138,0,0,10,1 80,1,123,0,35,1,388000,9.4,133,1,1,10,1 75,1,81,0,38,1,368000,4,131,1,1,10,1 62,0,231,0,25,1,253000,0.9,140,1,1,10,1 45,1,981,0,30,0,136000,1.1,137,1,0,11,1 50,1,168,0,38,1,276000,1.1,137,1,0,11,1 49,1,80,0,30,1,427000,1,138,0,0,12,0 82,1,379,0,50,0,47000,1.3,136,1,0,13,1 87,1,149,0,38,0,262000,0.9,140,1,0,14,1 45,0,582,0,14,0,166000,0.8,127,1,0,14,1 70,1,125,0,25,1,237000,1,140,0,0,15,1 48,1,582,1,55,0,87000,1.9,121,0,0,15,1 65,1,52,0,25,1,276000,1.3,137,0,0,16,0 65,1,128,1,30,1,297000,1.6,136,0,0,20,1 68,1,220,0,35,1,289000,0.9,140,1,1,20,1 53,0,63,1,60,0,368000,0.8,135,1,0,22,0 75,0,582,1,30,1,263358.03,1.83,134,0,0,23,1 80,0,148,1,38,0,149000,1.9,144,1,1,23,1 95,1,112,0,40,1,196000,1,138,0,0,24,1 70,0,122,1,45,1,284000,1.3,136,1,1,26,1 58,1,60,0,38,0,153000,5.8,134,1,0,26,1 82,0,70,1,30,0,200000,1.2,132,1,1,26,1 94,0,582,1,38,1,263358.03,1.83,134,1,0,27,1 85,0,23,0,45,0,360000,3,132,1,0,28,1 50,1,249,1,35,1,319000,1,128,0,0,28,1 50,1,159,1,30,0,302000,1.2,138,0,0,29,0 65,0,94,1,50,1,188000,1,140,1,0,29,1 69,0,582,1,35,0,228000,3.5,134,1,0,30,1 90,1,60,1,50,0,226000,1,134,1,0,30,1 82,1,855,1,50,1,321000,1,145,0,0,30,1 60,0,2656,1,30,0,305000,2.3,137,1,0,30,0 60,0,235,1,38,0,329000,3,142,0,0,30,1 70,0,582,0,20,1,263358.03,1.83,134,1,1,31,1 50,0,124,1,30,1,153000,1.2,136,0,1,32,1 70,0,571,1,45,1,185000,1.2,139,1,1,33,1 72,0,127,1,50,1,218000,1,134,1,0,33,0 60,1,588,1,60,0,194000,1.1,142,0,0,33,1 50,0,582,1,38,0,310000,1.9,135,1,1,35,1 51,0,1380,0,25,1,271000,0.9,130,1,0,38,1 60,0,582,1,38,1,451000,0.6,138,1,1,40,1 80,1,553,0,20,1,140000,4.4,133,1,0,41,1 57,1,129,0,30,0,395000,1,140,0,0,42,1 68,1,577,0,25,1,166000,1,138,1,0,43,1 53,1,91,0,20,1,418000,1.4,139,0,0,43,1 60,0,3964,1,62,0,263358.03,6.8,146,0,0,43,1 70,1,69,1,50,1,351000,1,134,0,0,44,1 60,1,260,1,38,0,255000,2.2,132,0,1,45,1 95,1,371,0,30,0,461000,2,132,1,0,50,1 70,1,75,0,35,0,223000,2.7,138,1,1,54,0 60,1,607,0,40,0,216000,0.6,138,1,1,54,0 49,0,789,0,20,1,319000,1.1,136,1,1,55,1 72,0,364,1,20,1,254000,1.3,136,1,1,59,1 45,0,7702,1,25,1,390000,1,139,1,0,60,1 50,0,318,0,40,1,216000,2.3,131,0,0,60,1 55,0,109,0,35,0,254000,1.1,139,1,1,60,0 45,0,582,0,35,0,385000,1,145,1,0,61,1 45,0,582,0,80,0,263358.03,1.18,137,0,0,63,0 60,0,68,0,20,0,119000,2.9,127,1,1,64,1 42,1,250,1,15,0,213000,1.3,136,0,0,65,1 72,1,110,0,25,0,274000,1,140,1,1,65,1 70,0,161,0,25,0,244000,1.2,142,0,0,66,1 65,0,113,1,25,0,497000,1.83,135,1,0,67,1 41,0,148,0,40,0,374000,0.8,140,1,1,68,0 58,0,582,1,35,0,122000,0.9,139,1,1,71,0 85,0,5882,0,35,0,243000,1,132,1,1,72,1 65,0,224,1,50,0,149000,1.3,137,1,1,72,0 69,0,582,0,20,0,266000,1.2,134,1,1,73,1 60,1,47,0,20,0,204000,0.7,139,1,1,73,1 70,0,92,0,60,1,317000,0.8,140,0,1,74,0 42,0,102,1,40,0,237000,1.2,140,1,0,74,0 75,1,203,1,38,1,283000,0.6,131,1,1,74,0 55,0,336,0,45,1,324000,0.9,140,0,0,74,0 70,0,69,0,40,0,293000,1.7,136,0,0,75,0 67,0,582,0,50,0,263358.03,1.18,137,1,1,76,0 60,1,76,1,25,0,196000,2.5,132,0,0,77,1 79,1,55,0,50,1,172000,1.8,133,1,0,78,0 59,1,280,1,25,1,302000,1,141,0,0,78,1 51,0,78,0,50,0,406000,0.7,140,1,0,79,0 55,0,47,0,35,1,173000,1.1,137,1,0,79,0 65,1,68,1,60,1,304000,0.8,140,1,0,79,0 44,0,84,1,40,1,235000,0.7,139,1,0,79,0 57,1,115,0,25,1,181000,1.1,144,1,0,79,0 70,0,66,1,45,0,249000,0.8,136,1,1,80,0 60,0,897,1,45,0 1="" 0,="" ℎ??????="" find="" e(x)="" and="" var(x).="" q3="" (3pts).="" leptin="" (from="" the="" greek="" word="" leptos,="" meaning="" thin)="" is="" a="" 16-kda="" protein="" hormone="" that="" plays="" a="" crucial="" role="" in="" regulating="" energy="" intake="" and="" energy="" expenditure,="" including="" the="" regulation="" (decrease)="" of="" appetite="" and="" (increase)="" of="" metabolism.="" serum="" leptin="" concentrations="" can="" be="" measured="" in="" several="" ways.="" one="" approach="" uses="" a="" radioimmunoassay="" in="" venous="" blood="" samples="" (linco="" research="" inc.,="" st="" charles,="" mo).="" several="" studies="" have="" consistently="" found="" women="" to="" have="" higher="" serum="" leptin="" concentrations="" than="" do="" men.="" for="" example,="" among="" us="" adults="" across="" a="" broad="" age="" range,="" the="" mean="" serum="" leptin="" concentration="" in="" women="" is="" approximately="" normal="" (12.7??/?,="" (1.3??/?)2)="" and="" in="" men="" approximately="" normal="" (4.6??/?,="" (0.5??/?)2).="" 1)="" what="" is="" the="" probability="" that="" leptin="" concentration="" in="" a="" randomly="" selected="" us="" adult="" male="" exceeds="" 6="" 2)="" what="" proportion="" of="" us="" women="" have="" the="" concentration="" of="" leptin="" in="" the="" interval="" 12.7="" ±="" 2??/??="" 3)="" what="" interval,="" symmetric="" about="" the="" mean="" 12.7??/?,="" contains="" leptin="" concentrations="" of="" 95%="" of="" adult="" us="" women?="" q4="" (5pts).="" take="" a="" sample="" of="" size="" n="10" from="" the="" poisson="" distribution="" with="" mean="" =3="" and="" compute="" the="" sample="" mean.="" repeat="" this="" procedure="" 10,000="" times="" and="" plot="" the="" histogram="" of="" sample="" means.="" then="" repeat="" this="" procedure="" for="" n="100," 1000.="" is="" there="" any="" trend="" observed="" in="" the="" histogram="" of="" the="" sample="" mean="" as="" n="" increases?="" what="" is="" the="" property="" of="" the="" sampling="" distribution="" of="" the="" sample="" mean="" for="" n="1000?" what="" are="" the="" mean="" and="" variance="" of="" this="" distribution?="" q5="" (5pts).="" use="" the="" data="" in="" hw1="" to="" make="" the="" following="" statistical="" inferences="" about="" the="" following="" attributes="" in="" a="" general="" heart="" disease="" population="" where="" the="" data="" were="" generated.="" 1)="" construct="" the="" 95%="" confidence="" intervals="" for="" average="" creatinine="" phosphokinase="" (cpk)="" levels="" in="" deceased="" and="" alive="" patients="" in="" the="" population,="" respectively.="" 2)="" construct="" the="" 95%="" confidence="" intervals="" for="" variances="" of="" cpk="" levels="" in="" deceased="" and="" alive="" patients="" in="" the="" population,="" respectively.="" 3)="" construct="" the="" 95%="" confidence="" intervals="" for="" proportions="" of="" diabetes="" in="" deceased="" and="" alive="" patients="" in="" the="" population,="" respectively.="" justify="" the="" sampling="" distributions="" used="" for="" the="" calculation="" in="" (1)-(3).="" you="" may="" use="" the="" histograms="" of="" the="" cpk="" levels="" for="" 1)="" and="" 2).="" submission.="" submit="" a="" zip="" file="" (hw3_name.zip)="" on="" blackboard="" that="" includes:="" 1)="" both="" r="" notebook="" (.rmd)="" and="" rendered="" results="" (.html).="" your="" notebook="" should="" include="" some="" annotations="" for="" the="" scripts="" so="" that="" a="" grader="" knows="" what="" the="" script="" is="" for.="" 2)="" report="" document="" (.pdf)="" age,anaemia,creatinine_phosphokinase,diabetes,ejection_fraction,high_blood_pressure,platelets,serum_creatinine,serum_sodium,sex,smoking,time,death_event="" 75,0,582,0,20,1,265000,1.9,130,1,0,4,1="" 55,0,7861,0,38,0,263358.03,1.1,136,1,0,6,1="" 65,0,146,0,20,0,162000,1.3,129,1,1,7,1="" 50,1,111,0,20,0,210000,1.9,137,1,0,7,1="" 65,1,160,1,20,0,327000,2.7,116,0,0,8,1="" 90,1,47,0,40,1,204000,2.1,132,1,1,8,1="" 75,1,246,0,15,0,127000,1.2,137,1,0,10,1="" 60,1,315,1,60,0,454000,1.1,131,1,1,10,1="" 65,0,157,0,65,0,263358.03,1.5,138,0,0,10,1="" 80,1,123,0,35,1,388000,9.4,133,1,1,10,1="" 75,1,81,0,38,1,368000,4,131,1,1,10,1="" 62,0,231,0,25,1,253000,0.9,140,1,1,10,1="" 45,1,981,0,30,0,136000,1.1,137,1,0,11,1="" 50,1,168,0,38,1,276000,1.1,137,1,0,11,1="" 49,1,80,0,30,1,427000,1,138,0,0,12,0="" 82,1,379,0,50,0,47000,1.3,136,1,0,13,1="" 87,1,149,0,38,0,262000,0.9,140,1,0,14,1="" 45,0,582,0,14,0,166000,0.8,127,1,0,14,1="" 70,1,125,0,25,1,237000,1,140,0,0,15,1="" 48,1,582,1,55,0,87000,1.9,121,0,0,15,1="" 65,1,52,0,25,1,276000,1.3,137,0,0,16,0="" 65,1,128,1,30,1,297000,1.6,136,0,0,20,1="" 68,1,220,0,35,1,289000,0.9,140,1,1,20,1="" 53,0,63,1,60,0,368000,0.8,135,1,0,22,0="" 75,0,582,1,30,1,263358.03,1.83,134,0,0,23,1="" 80,0,148,1,38,0,149000,1.9,144,1,1,23,1="" 95,1,112,0,40,1,196000,1,138,0,0,24,1="" 70,0,122,1,45,1,284000,1.3,136,1,1,26,1="" 58,1,60,0,38,0,153000,5.8,134,1,0,26,1="" 82,0,70,1,30,0,200000,1.2,132,1,1,26,1="" 94,0,582,1,38,1,263358.03,1.83,134,1,0,27,1="" 85,0,23,0,45,0,360000,3,132,1,0,28,1="" 50,1,249,1,35,1,319000,1,128,0,0,28,1="" 50,1,159,1,30,0,302000,1.2,138,0,0,29,0="" 65,0,94,1,50,1,188000,1,140,1,0,29,1="" 69,0,582,1,35,0,228000,3.5,134,1,0,30,1="" 90,1,60,1,50,0,226000,1,134,1,0,30,1="" 82,1,855,1,50,1,321000,1,145,0,0,30,1="" 60,0,2656,1,30,0,305000,2.3,137,1,0,30,0="" 60,0,235,1,38,0,329000,3,142,0,0,30,1="" 70,0,582,0,20,1,263358.03,1.83,134,1,1,31,1="" 50,0,124,1,30,1,153000,1.2,136,0,1,32,1="" 70,0,571,1,45,1,185000,1.2,139,1,1,33,1="" 72,0,127,1,50,1,218000,1,134,1,0,33,0="" 60,1,588,1,60,0,194000,1.1,142,0,0,33,1="" 50,0,582,1,38,0,310000,1.9,135,1,1,35,1="" 51,0,1380,0,25,1,271000,0.9,130,1,0,38,1="" 60,0,582,1,38,1,451000,0.6,138,1,1,40,1="" 80,1,553,0,20,1,140000,4.4,133,1,0,41,1="" 57,1,129,0,30,0,395000,1,140,0,0,42,1="" 68,1,577,0,25,1,166000,1,138,1,0,43,1="" 53,1,91,0,20,1,418000,1.4,139,0,0,43,1="" 60,0,3964,1,62,0,263358.03,6.8,146,0,0,43,1="" 70,1,69,1,50,1,351000,1,134,0,0,44,1="" 60,1,260,1,38,0,255000,2.2,132,0,1,45,1="" 95,1,371,0,30,0,461000,2,132,1,0,50,1="" 70,1,75,0,35,0,223000,2.7,138,1,1,54,0="" 60,1,607,0,40,0,216000,0.6,138,1,1,54,0="" 49,0,789,0,20,1,319000,1.1,136,1,1,55,1="" 72,0,364,1,20,1,254000,1.3,136,1,1,59,1="" 45,0,7702,1,25,1,390000,1,139,1,0,60,1="" 50,0,318,0,40,1,216000,2.3,131,0,0,60,1="" 55,0,109,0,35,0,254000,1.1,139,1,1,60,0="" 45,0,582,0,35,0,385000,1,145,1,0,61,1="" 45,0,582,0,80,0,263358.03,1.18,137,0,0,63,0="" 60,0,68,0,20,0,119000,2.9,127,1,1,64,1="" 42,1,250,1,15,0,213000,1.3,136,0,0,65,1="" 72,1,110,0,25,0,274000,1,140,1,1,65,1="" 70,0,161,0,25,0,244000,1.2,142,0,0,66,1="" 65,0,113,1,25,0,497000,1.83,135,1,0,67,1="" 41,0,148,0,40,0,374000,0.8,140,1,1,68,0="" 58,0,582,1,35,0,122000,0.9,139,1,1,71,0="" 85,0,5882,0,35,0,243000,1,132,1,1,72,1="" 65,0,224,1,50,0,149000,1.3,137,1,1,72,0="" 69,0,582,0,20,0,266000,1.2,134,1,1,73,1="" 60,1,47,0,20,0,204000,0.7,139,1,1,73,1="" 70,0,92,0,60,1,317000,0.8,140,0,1,74,0="" 42,0,102,1,40,0,237000,1.2,140,1,0,74,0="" 75,1,203,1,38,1,283000,0.6,131,1,1,74,0="" 55,0,336,0,45,1,324000,0.9,140,0,0,74,0="" 70,0,69,0,40,0,293000,1.7,136,0,0,75,0="" 67,0,582,0,50,0,263358.03,1.18,137,1,1,76,0="" 60,1,76,1,25,0,196000,2.5,132,0,0,77,1="" 79,1,55,0,50,1,172000,1.8,133,1,0,78,0="" 59,1,280,1,25,1,302000,1,141,0,0,78,1="" 51,0,78,0,50,0,406000,0.7,140,1,0,79,0="" 55,0,47,0,35,1,173000,1.1,137,1,0,79,0="" 65,1,68,1,60,1,304000,0.8,140,1,0,79,0="" 44,0,84,1,40,1,235000,0.7,139,1,0,79,0="" 57,1,115,0,25,1,181000,1.1,144,1,0,79,0="" 70,0,66,1,45,0,249000,0.8,136,1,1,80,0="">
Answered Same DayOct 13, 2021

Answer To: BME 530 Assignment 3 Using R to complete all assignments if applicable. Q1 (3pts). Blood Types. The...

Suraj answered on Oct 14 2021
122 Votes
New folder/93654.docx
Solution 1:
The prevalence of blood type in US population is given as follows:
1)
A random sample of 24 subjects is selected.
Let X be random variable describe A+ subjects.
The probability that 8 subjects are A+ using binomial
distribution,
> dbinom(8,24,0.357)
[1] 0.1656864
2)
A random sample of 500 subjects is selected.
Let Y be random variable describe B- subjects.
The probability that at least 2 subjects are B- using binomial distribution.
> 1-pbinom(1,500,0.015)
[1] 0.9954988
3)
Using poission approximation probability is calculated as follows:
> 1-ppois(1,lmda)
[1] 0.9952988
Solution 2:
Consider the given table,
Thus,
Hence,
2)
The density function is given as follows:
Solution 3:
The mean serum leptin concentration in women is approximately normal ?(12.7??/?, 1.3??/?)
For men approximately normal ?(4.6??/?,0.5??/?).
1)
The probability that leptin concentration in a randomly selected US adult male exceeds 6 ??/?,
> 1-pnorm(6,4.6,0.5)
[1] 0.00255513
2)
The proportion of US women have the concentration of leptin in the interval 12.7±2??/? that is between 10.7 to 14.7,
> a<-pnorm(14.7,12.7,1.3)- pnorm(10.7,12.7,1.3)
> a
[1] 0.8760642
3)
The interval symmetric about mean 12.7 that contain 95% of adults US women,
> lower<-qnorm(0.025,12.7,1.3)
> uper<-qnorm(0.975,12.7,1.3)
> lower
[1] 10.15205
> uper
[1] 15.24795
Thus, interval is (10.15, 15.25).
Solution 4:
The histogram for n = 10000, 100 and 1000 are given as follows:
Here, we can see that as the value of sample size n is increasing the sampling distribution become more symmetric about the population mean 3.
The mean of sampling distribution is 3 and variance is 3/10000, 3/100, and 3/1000.
As Poisson distribution has mean and variance same that is 3.
Solution 5:
For calculation of the confidence interval, we assume that the sampling distribution of the variables are normally distributed because that sample size is 299 which is greater than 30. Hence, according to central limit theorem, it follows normal distribution.
The confidence intervals for mean of CPK with diseased and not diseased subjects respectively,
Diseased
> norm.interval(sub$creatinine_phosphokinase, 2)
[1] 669.9150 670.4808
Not Diseased
> norm.interval(sub1$creatinine_phosphokinase, 2)
[1] 539.8596 540.2487
Confidence interval for variance,
> var.interval(sub$creatinine_phosphokinase)
[1] 1329519 2354978
> var.interval(sub1$creatinine_phosphokinase)
[1] 471849.9 697608.8
For proportion of diabetes,
[1]...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here