Homework 3– Intro to R, Omitted Variable Bias, and Randomized Control Trials Prof. Beheshti September 3, 2020 R Problems Note: You must submit your code to earn credit. Problem 1. If we list all the...

problem 3 and 4


Homework 3– Intro to R, Omitted Variable Bias, and Randomized Control Trials Prof. Beheshti September 3, 2020 R Problems Note: You must submit your code to earn credit. Problem 1. If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. Note: This problem was taken from https://projecteuler.net/archives, which you should check out! Problem 2. Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. Note: Another Project Euler problem. Problem 3. Download the S&P500 returns data from Blackboard. Suppose you invested $10,000 in 1980. How much money would you have by the end of 2019? Problem 4. Hard problem: Suppose that instead of investing $10,000 in 1980 you in- vested $x. Plot the amount of money you would have in 2019 for all values of $x between $0 and $100,000. Life Tip: start investing your savings as soon as you possibly can! Written Problems Problem 5. Using the numbers in the example in Lecture 6, compute the fraction of moth- ers who gave birth to children with birth defects in each of the following groups: (1) coffee 1 drinkers and cocaine users, (2) coffee drinkers and non-cocaine users, (3) non-coffee drinkers and cocaine users, (4) non-coffee drinkers and non-cocaine users. What is the difference in prevalence of birth defects among groups (1) and (3)? (2) and (4)? What does this tell us about the effect of coffee consumption on the probability of birth defects? Note: you can assume their are no other omitted variables to worry about. Problem 6. Suppose we randomly assign half of the mothers to drink coffee and the other half to abstain. What is the prevalence of birth defects in each group? 2
Sep 11, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here