Question

Write R code: The National Institute of Diabetes and Digestive and Kidney Diseases conducted a study...

Write R code:

The National Institute of Diabetes and Digestive and Kidney Diseases conducted a study on 768 adult female Pima Indians living near Phoenix. One variable that was collected is bmi (body mass index) which represents weight in kg/ (height in meters squared). The pima data set is available in the Faraway library. Compute the mean, 0.05 trimmed mean, 0.10 trimmed mean, 0.05 winsorized mean, and 0.10 winsorized mean.
Hint: #need psych library. The variable of interest is pima$bmi.

library(psych)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I will enter the R codes along with output below. I will highlight the output using bold.

> library(psych)
> library(faraway)
> data(pima) # calling the data
> View(pima) # to view the data
> x<-pima$bmi
> # Computing the mean
> mean(x)
[1] 31.99258
> # computing 0.05 trimmed mean
> mean(x,trim=0.05)
[1] 32.05564
> # computing 0.10 trimmed mean
> mean(x,trim=0.10)
[1] 31.95925
> # computing 0.05 winsorized mean
> winsor.mean(x,trim=0.05,na.rm=T)
[1] 32.1586
> # computing 0.10 winsorized mean
> winsor.mean(x,trim=0.10,na.rm=T)
[1] 32.07617

Add a comment
Know the answer?
Add Answer to:
Write R code: The National Institute of Diabetes and Digestive and Kidney Diseases conducted a study...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • explaim the mechanisms amd toxological effects if type 1 diabetes in this article Exposure to arsenic...

    explaim the mechanisms amd toxological effects if type 1 diabetes in this article Exposure to arsenic in drinking water is associated with increased prevalence of diabetes. We previously reported an association of diabetes and urinary concentration of dimethylarsinite (DMAS"), a toxic product of arsenic methylation by arsenic (+ 3 oxidation state) methyltransferase (AS3MT). Here we examine associations between AS3MT polymorphism, arsenic metabolism and diabetes. Fasting blood glucose, oral glucose tolerance and self-reported diagnoses were used to identify diabetic individuals. Inorganic...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT