Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ECO 321 Fall 2020 Homework 1 Due September 4 by 5 pm Cut and paste at the end of your submission the R code you
ECO 321 Fall 2020
Homework 1
Due September 4 by 5 pm
Cut and paste at the end of your submission the R code you have used in problem 2 to show your work.
- Suppose in a survey of n = 1000 students, 600 responded that they prefer small classes and 400 responded that they prefer large classes. Let p denote the fraction of all students who preferred small classes at the time of the survey, and X be the fraction of survey respondents who preferred small classes. (Hint: X is distributed as a Bernoulli random variable)
- (a)Show that E(X ) = p and Var(X ) = p(1 p)/n.
- (b)Use the survey result to estimate p, and calculate the standard error of your
- estimator. (Hint: Notice that this is the same as estimating the sample mean)
- On Blackboard under the Homework1 folder, you can find a zip file birthweight.zip which contains a database birthweight smoking.csv for birth weight of infant (in grams) with an indicator equal to one if the mother smoked during pregnancy and zero, otherwise. A detailed description is given in the pdf file Data description. you will investigate the the relationship between a mother smoked during pregnancy (smoker) and birth weight of infant (birthweight). smoker takes value 1 is the mother smoked during pregnancy and 0 otherwise. (Hint: If you are looking for general methods to save plots in R, please look at the following webpage http://www.sthda.com/english/wiki/creating-and-saving-graphs-r-base-graphs. Do not use "Export" command )
- (a)Load the dataset into R and call it data weight. What command did you use? (Do not use the "import dataset" command in Rstudio.)
- (b)How many observations are there in your sample? How many variables?
- (c)Rename the variable birthweight to brght
- (d)Report the min, max and quartiles of brght.
- (e) a histogram for brght with density for Y-Axis instead of frequency.
- (f)Report the mean, standard deviation and skewness of brght. Would you say that this variable is normally distributed based on the value of skewness?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started