首页 > > 详细

调试SPSS、php讲解、辅导Java编程、R设计解析、解析数据结构

hw1.pdf 1

Statistics
HQU, Fall 2018
Homework 1
S. Yen
9/7/18 (updated 9/13/18)

Due: To be announced (TBA)

A random sample of 500 French men is drawn from the full sample in Nichèle and Yen (2016).
Data file hw1.csv is downloadable from Baidu. Variables include body mass index (BMI) and
age. Define body weight categories as follows:
Underweight: BMI 29.9
a. First, select a random sample of 50 men (use a random seed of 12345671). Construct a
frequency distribution table, covering frequency, relative frequency, percent frequency,
cumulative frequency, and cumulative relative frequency, manually. To get you going with
the homework, download data file hw1.50.csv for the sub-sample from Baidu.
b. Construct a bar chart of BMI categories based on the above frequency, manually.
c. Construct a pie chart of BMI categories, manually.
d. Construct a stem-and-leaf display for age.
d-2. Construct a frequency distribution table for age, covering frequency, relative frequency,
percentage frequency, cumulative frequency, cumulative relative frequency, and cumulative
percentage frequency. Use a cell width of 10, and consider a class range of 20-29 for the
first class. Interpret the frequencies (one of each type).
d-3. Construct a frequency histogram corresponding to the frequency distribution in part (d-2).
Now, back to the full sample of n = 500. Do the following with R.
e. Construct a frequency distribution table for BMI categories, covering frequency, relative
frequency, percent frequency, cumulative frequency, and cumulative relative frequency.
f. Construct a bar chart of BMI categories.
g. Construct a pie chart of BMI categories.
h. Now, restrict the sample to men age 50 and under, and use this sample for the rest of the
homework. Construct a frequency distribution table for age, covering frequency, relative
frequency, percentage frequency, cumulative frequency, cumulative relative frequency, and
cumulative percentage frequency. Use a cell width of 5.
i. Construct a frequency histogram corresponding to the frequency distribution in part (h).
j. Construct a stem-and-leaf display for age, using R.

Note: Below are some R commands needed for this homework.

# To select a random sample, use the command
set.seed(12345671)
j=18.5)*(bmi24.9)*(bmi29.9)*3)
# To classify BMI categories,
hw1.pdf 2

bmicat<-factor(obmi,
labels=c("Underweight","Normal","Overweight","Obese"))
# To restrict the sample by age,
mydata<-subset(mydata,age≤50)

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!