Final Exam Fall 2022

docx

School

University of Houston *

*We aren’t endorsed by this school

Course

4386

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

2

Uploaded by ProfessorOtterPerson1284

Report
# Final Exam Fall 2022 #please choose 5 questions to answer #Run the below codes without changing anything library( tidyverse ) library( ggplot2 ) library( gapminder ) gapminder #Run the below codes without changing anything sing <- gapminder %>% filter ( country == "Singapore" ) View( sing ) #Q1: plot a line chart, with y axis being the LifeExp, x axis being gdpPercap ggplot( data = sing ,aes( x = gdpPercap , y = lifeExp ))+geom_line() #Q2: plot a line chart of lifeExp throughout the years. ggplot( data = sing ,aes( x = year , y = lifeExp ))+geom_line() #Q3: build a linear model of lifeExp and gdp s1 <-lm( lifeExp ~ gdpPercap , sing ) summary( s1 ) #Q4: what is the equation? (it;s okay to use the scientific notation in your formula) lifeExp = 3.858e-04 * gdpPercap + 6.450e+01 #Q5: what does the p-value mean for this model? #Q6: please interpret the coefficient #Run this code do not change anything #Multiple Linear Regression hd <-read.csv( "heart.csv" , header = T ) hd.lm <- lm( heart.disease ~ biking + smoking , data = hd ) summary( hd.lm ) #Q7: Please interpret the coefficients.
#Q8: plot biking and heart.disease in scatter plot ggplot( data = hd , aes( x = biking , y = heart.disease ))+geom_point()
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help