Github link: Web link:

library(tidyverse) #loading all library needed for this assignment
library(openintro)
library(infer)
library(gplots)
#head(fastfood)
#library(readxl)
#library(data.table)
#library(readr)
#library(plyr)
#library(dplyr)
#library(dice)
# #library(VennDiagram)
# #library(help = "dice")
#library(DBI)
#library(dbplyr)

#library(rstudioapi)
#library(RJDBC)
#library(odbc)
#library(RSQLite)
#library(rvest)
#library(stringr)
#library(readtext)
#library(ggpubr)
#library(fitdistrplus)
#library(ggplot2)
#library(moments)
#library(qualityTools)
library(normalp)
#library(utils)
#library(MASS)
#library(qqplotr)
library(DATA606)
## 
## Welcome to CUNY DATA606 Statistics and Probability for Data Analytics 
## This package is designed to support this course. The text book used 
## is OpenIntro Statistics, 3rd Edition. You can read this by typing 
## vignette('os3') or visit www.OpenIntro.org. 
##  
## The getLabs() function will return a list of the labs available. 
##  
## The demo(package='DATA606') will list the demos that are available.
getLabs()
##  [1] "Lab1"  "Lab2"  "Lab3"  "Lab4"  "Lab5a" "Lab5b" "Lab6"  "Lab7"  "Lab8" 
## [10] "Lab9"
#library(StMoSim)

Github Lin https://github.com/asmozo24/DATA606_Homework6 Web Link:

Exercice 1 : 6.48 2010 Healthcare Law

On June 28, 2012 the U.S. Supreme Court upheld the much debated 2010 healthcare law, declaring it constitutional. A Gallup poll released the day after this decision indicates that 46% of 1,012 Americans agree with this decision. At a 95% con dence level, this sample has a 3% margin of error. Based on this information, determine if the following statements are true or false, and explain your reasoning.49

#(a) We are 95% confident that between 43% and 49% of Americans in this sample support the decision of the U.S. Supreme Court on the 2010 healthcare law. Answe: False. Based on the of the problem. 46% of 1,012 Americans agree with this decision and that is the 95% confidence level.

#(b) We are 95% confident that between 43% and 49% of Americans support the decision of the U.S. Supreme Court on the 2010 healthcare law. Answer: true. I want to agree on the fact that for a large sample population (in this case population = Americans) the points of estimate of the population proportion will be about 46% ± % 3% margin of error.so, (43, 49)

#(c) If we considered many random samples of 1,012 Americans, and we calculated the sample proportions of those who support the decision of the U.S. Supreme Court, 95% of those sample proportions will be between 43% and 49%. Answer: true, we went through this question in lab5. Running random sample of 1,012 Americans many time, then 95% of those sample proportions will be between 43% and 49%. Actually, we found out if the rerun is at large scale then, we will be about the 46%.

#(d) The margin of error at a 90% confidence level would be higher than 3%. Answer: False, from lab5 we found out the margin error decreases if the confidence level decrease and the confidence interval will be narrowed.

Exercice 2: 6.10 Legalization of marijuana, Part I.

The General Social Survey asked 1,259 US residents: “Do you think the use of marijuana should be made legal, or not?” 48% of the respondents said it should be made legal.

(a) Is 48% a sample statistic or a population parameter? Explain.

Answer: this is a sample statistic (a defined number of observations randomly selected from a population). I think the the labor bureau or US homeLand department probably has the U.S. population parameter.