STA 301 Regression Models & Interactions

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/298

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:28 PM on 9/8/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

299 Terms

1
New cards

Which of the following statements about course policies on Knowledge Checks (KCs) is accurate? Select all correct answers.

-We drop your lowest KC score in calculating your overall KC average for the semester

-Any requests to drop an additional KC or for an extension must be accompanied with a verification of absence from Student Emergency Services

-Canvas will save the highest score from your quiz attempts. For example, if you earn 90% on your second attempt and 84% on your third attempt, Canvas will retain your score of 90%

2
New cards

Students who feel that their homework was not evaluated fairly via the peer grading process will have an opportunity to appeal. Students who want to appeal a homework grade should do which of the following?

Complete the Homework Appeal Survey posted on Canvas within one week after grades are posted for that homework.

3
New cards

Which of the following statements about course grading policies is accurate? Select all correct answers.

-While we reserve the right to lower grade cutoff values (i.e., make them more generous) at our sole discretion, we will not raise them.

-As with all McCombs classes, course grades are not numerically rounded (e.g., an 89.99 is not rounded up to 90).

-The cutoff for a B grade is 84%.

4
New cards

Which of the following instructions should students follow for each homework assignment? Select all correct answers.

-Upload the homework write-up as a PDF file on the Canvas assignment page.

-Do not include or re-type the homework assignment questions or instructions in your write-up.

-Save and submit the R script that you created for analysis to complete the homework write-up. The R script will not be graded, but you must submit the script to receive credit on the write-up.

5
New cards

Which of the following statements about course policies on Class Participation is accurate? Select all correct answers.

-The number of available class participation points for the semester will not be determined in advance.

-Students who earn 70% of available class participation points will receive full credit on the class participation portion (5%) of their course grade.

-Class participation points may be earned from in-class activities including polls, reading quizzes, and short feedback surveys.

6
New cards

Which of the following statements about our course Midterm Exam is accurate? Select all correct answers.

-If you don't have RStudio installed and working on your computer, you will not be able to complete all the questions on the exam.

-You will take the midterm exam using your own computer in our classroom during class.

-The midterm exam will be open-notes and open-book and open-internet.

7
New cards

Match each grade component with the correct percentage weight used to calculate course grades.

Class Participation: 5%

Knowledge Checks: 20%

Midterm Exam: 20%

Homework: 25%

Final Exam: 30%

8
New cards

When we calculate your final homework average, how many homework grades do we drop?

0

9
New cards

Required materials for this class include which of the following? Select all correct answers

-R and RStudio installed on your computer.

-A free online book, "Data Science in R: A Gentle Introduction"

-Chrome or Firefox web browser for working in Canvas, of particular importance during quizzes and exams.

-Laptop or desktop computer with modern and updated operating system (MacOS, Windows or Linux).

10
New cards

Which of the following statements about the Final Exam is accurate? Select all correct answers.

-The Final Exam must be completed alone. You may not seek or receive aid in answering questions from any classmate or any other person.

-You will take the final exam using your own computer in the location of your choice.

-If your final exam score is higher than your midterm score, then it will replace your midterm score when calculating your final course grade.

-The final exam will be open-notes and open-book and open-internet.

11
New cards

Bitcoin is a decentralized digital currency that functions without a central bank. It was first released as open-source software in 2009. Since then, many of these cryptocurrencies have raised money through Initial Coin Offerings (ICOs). A data frame gives information on nine ICOs that have raised more than $100 million. For each ICO, the dataset lists an ID (numbered from 1 to 9), the name of the cryptocurrency, the location of the ICO, the date of the ICO, the price of Bitcoin on the date of the ICO, and the amount of funding raised (in millions of U.S. dollars).

Which of the following best represents the cases of this data frame?

ICOs

12
New cards

Consider the following data frame on five airplane models operated by major commercial carriers.

CaseID Manufacturer Model First flight MaxPassengers

1 Boeing 737 1967 215

2 Boeing 747 1969 605

3 Boeing 787 2009 330

4 Airbus A320 1987 186

5 Airbus A380 2005 853

Which of the following statements about this data frame is/are accurate? Select all correct answers.

-"Model" is a categorical variable.

-"First flight" is a numerical variable.

-"CaseID" is a numerical variable.

-Each case in this data frame corresponds to an airplane manufacturer.

-"Max passengers" is a categorical variable.

-"Manufacturer" is a categorical variable.

13
New cards

Bitcoin is a decentralized digital currency that functions without a central bank. It was first released as open-source software in 2009. Since then, many of these cryptocurrencies have raised money through Initial Coin Offerings (ICOs). A data frame gives information on nine ICOs that have raised more than $100 million. For each ICO, the dataset lists an ID (numbered from 1 to 9), the name of the offered currency, the location of the ICO, the date of the ICO, the price of Bitcoin on the date of the ICO, and the amount of funding raised (in millions of U.S. dollars).

Which of the following variables in this data frame is/are numerical? Select all correct answers.

-The price of Bitcoin on the date of the ICO

-Amount raised

14
New cards

Match the terms below to their correct definitions.

-Population: The set of all possible cases that might have been included in a data set.

-Sample: A specific selection of cases from the population.

-Data frame: A tabular representation of a data set in which the rows correspond to cases and the columns to variables.

-Code book: A file or separate list that provides all the necessary information to interpret each variable in a data set

-Unit of analysis: The type of entity you choose to focus on in a data analysis

-Sampling bias: Any systematic discrepancy between a sample and the corresponding population

15
New cards

Which of the following statements about R scripts is/are correct? Select all correct answers.

-A script is a file that collects multiple statements (i.e. lines of R code) in a single document.

-Scripts make it simple to save your work and pick up where you left off, without having to remember what you've accomplished already.

-One way to run R statements from a script is to highlight those statements and then hit Control-Enter on the keyboard.

-Scripts make it easy to modify a complex analysis by adding or changing steps in the middle of a long chain of statements.

16
New cards

Which of the following statements about R libraries are correct?

-Libraries need to be loaded each time you want to use them.

-A library is a piece of software that provides additional functionality to RStudio, beyond what's contained in the basic R installation.

17
New cards

Make sure you're familiar with the concept of an "object Links to an external site." from our course packet, which is essential to coding in R. Then consider the following block of R code.

objectA = 10objectB = 2*objectA + 10objectC = objectB/6

Which of the following statements about this code block are correct?

-This block of code illustrates the assignment of values to objects using R's assignment operator (=).

-This code block will run just fine if you type it directly into the console. But the best practice here would be to type the commands into a script instead, and then run those commands from the script.

-If we were to run this block of code, one result will be that objectB should now store the value 30.

18
New cards

Match the sampling terms below to the best description below.

-Random sample: A sample in which every member of the population is equally likely to be included.

-Longitudinal sample: A sample based on individual cases tracked over time with respect to one or more variables.

-Cross-sectional sample: A sample based on various attributes of individual cases collected at a single point in time.

-Convenience sample: A sample based on individual units that were not selected at random from the population of interest.

-Census: A sample that comprises all cases in the population.

19
New cards

microfi_households %>%filter(village == 46) %>%summarize(loan_prop = mean(loan)) %>%round(3)

Upon running these commands, you should see a three-digit decimal number printed out under the word "loan_prop" in your console. What number do you see?

0.073

20
New cards

Netflix collects data every time a subscriber uses its platform, including the variables listed below. Which of these variables are categorical?

-The U.S. state in which the subscriber resides

-The genre of the show/movie

-The day of the week

21
New cards

Use the music festivals dataset (aclfest.csv Download aclfest.csv) --- as seen in class and in Lesson 3 on Counting Links to an external site. --- to answer the following.

What is the joint probability that a band from this sample played both Outside Lands and Bonnaroo in the same year?

Express your answer as a probability between 0 and 1, and round your answer to 3 decimal places.

0.026

22
New cards

Use the music festivals dataset (aclfest.csv Download aclfest.csv) --- as seen in class and in Lesson 3 on Counting Links to an external site. --- to answer the following.

What is the conditional probability that a band played Coachella, given that they played ACL Fest in the same year?

Express your answer as a probability between 0 and 1, and round your answer to 3 decimal places.

0.392

23
New cards

The file plays_top50.csv Download plays_top50.csvcontains data about 15,000 users of a music streaming service. The first column is a unique numerical identifier for the user. The remaining columns are for the top 50 artists most frequently streamed by this particular subset of users. The entries in the data frame represent "did play" (1) and "did not play" (0), with 1 meaning that a given user streamed a given artist at least once during the data-collection period.

For a randomly selected user from this sample, what is P(plays Coldplay or plays Muse)? Express your answer as a number between 0 and 1, rounded to 3 decimal places.

0.234

24
New cards

t1 = xtabs(~acl + lollapalooza, data=aclfest)

t1 %>%

prop.table(margin=2) %>%

round(3)

Which of following statements about this code block are correct?

-This code creates a table of counts and stores it in an object called t1.

-The pipe operator (%>%) is always used to feed the result of one calculation into the next calculation, as illustrated in this code block.

25
New cards

The file plays_top50.csv Download plays_top50.csvcontains data about 15,000 users of a music streaming service. The first column is a unique numerical identifier for the user. The remaining columns are for the top 50 artists most frequently streamed by this particular subset of users. The entries in the data frame represent "did play" (1) and "did not play" (0), with 1 meaning that a given user streamed a given artist at least once during the data-collection period.

For a randomly selected user from this sample, what is P(plays Bob Dylan | plays the Beatles)? Express your answer as a number between 0 and 1, rounded to 3 decimal places.

0.194

26
New cards

The British ocean liner Titanic sank into the North Atlantic Ocean on April 15, 1912. This contingency table displays the survival outcomes for 2,201 passengers:

Outcome

Passenger Class or Crew Survived Did not survive

1st class 203 122

2nd class 118 167

3rd class 178 528

Crew 212 673

What is P(Crew | Survived)?

0.298

27
New cards

Research indicates that 60% of US adults ages 18-29 have used Snapchat, 65% have used Instagram, and 47% have used both. What is the probability that someone in this demographic uses neither Snapchat nor Instagram?

0.22

28
New cards

The file plays_top50.csv Download plays_top50.csvcontains data about 15,000 users of a music streaming service. The first column is a unique numerical identifier for the user. The remaining columns are for the top 50 artists most frequently streamed by this particular subset of users. The entries in the data frame represent "did play" (1) and "did not play" (0), with 1 meaning that a given user streamed a given artist at least once during the data-collection period.

For a randomly selected user from this sample, what is P(plays Franz Ferdinand)? Express your answer as a number between 0 and 1, rounded to 3 decimal places.

0.059

29
New cards

Lyra is 31 years old, outspoken, and very bright. She majored in philosophy as an undergraduate at Oxford. As a student, she was deeply concerned with issues of discrimination and social justice, and also participated in anti-nuclear demonstrations. Which of the following events is more probable?

Event 1: Lyra is a bank teller

Event 2: Lyra is a bank teller and is active in the feminist movement

Event 1 is more probable

30
New cards

The marketing team at VRBO, a vacation rental platform, wants to gain market share from competitors such as Airbnb and Hotels.com by attracting travelers to book accommodations on their platform.

Survey results indicate that in the past year, 23% of the target market segment have used Airbnb, 35% have used Hotels.com, and 13% have used both Airbnb and Hotels.com. Consider two events in this market segment:

A is the event that a randomly-selected individual has used Airbnb

H is the event that a randomly-selected individual has used Hotels.com

Which of the following is true of events A and H?

events A and H are not independent and are not mutually exclusive.

31
New cards

A private wealth manager notes that 45% of their clients have bonds in their portfolio, while 15% have options in their portfolio. Of those clients who invest in bonds, 27% also have invested in options.

Which of the following is closest to the probability that a client invests in bonds given that they have invested in options?

0.81

32
New cards

Research from 2019 indicates that 60% of US adults ages 18-29 have used Snapchat, 65% have used Instagram, and 47% have used both. What is the probability that someone in this demographic uses neither Snapchat nor Instagram? Express your answer as a probability between 0 and 1, rounded to two decimal places.

0.22

33
New cards

There was fierce competition for tickets to the Jimmy Fallon show hosted on the UT Austin campus. A student who entered the ticket lottery had only a 5% chance of getting a ticket. However, students in the marching band had a 30% chance of getting a ticket. Of all students who entered the lottery, 7% were in the marching band.

What proportion of lottery entrants received a ticket and were in the marching band?

Enter your answer as a decimal rounded to three digits. For example, 53.7% = 0.537.

0.021

34
New cards

This contingency table displays the distribution of the 538 electoral college votes in the 2016 Presidential Election with respect to geographical region and election outcome (Republican or Democratic).

Total Electoral Votes

Democratic Republican

South 0 162

West 98 30

Northeast 101 29

Midwest 30 88

Consider the following events:

An electoral vote is cast in the South region

An electoral vote is cast for the Democratic candidate

Using probabilities derived from the contingency table above, which of the statements below is/are correct?

The two events South and Democratic:

(1) are mutually exclusive.

(2) are not independent.

(3) are equally likely.

1 and 2

35
New cards

Which of the following statements about independence are correct? Select all correct answers.

-Two events A and B are independent if P(A) = P(A | B)

-Two events A and B are independent if P(A,B) = P(A) • P(B)

36
New cards

A media buyer cross-tabulates her data set with information about 200 brands in their portfolio and the platforms with which each brand is allocating advertising resources.

Buy ads Facebook?

Yes No

Buy adds Yes 80 53

Youtube? No 46 21

Of the brands that (Yes) buy ads on Facebook, the proportion that (No) do not buy ads on YouTube is closest to which of the following?

0.37

37
New cards

Which of the following three statements is/are accurate? The grammar of graphics is a theoretical framework for data visualization that:

(1) defines a set of rules for creating graphics by combining different types of layers.

(2) is implemented in R with the ggplot2 package.

(3) conceptualizes a statistical graphic as a mapping of data variables to aesthetic attributes of geometric objects.

All of the above (1, 2, and 3)

38
New cards

ggplot(tvshows) +

geom_point(aes(x=GRP, y=PE)) +

facet_wrap(~Genre)

Which of the following statements about this code block are correct? Choose all correct answers.

-This code block illustrates the use of faceting, and will produce a panel of multiple scatter plots (one plot for each genre).

-This plot will show the GRP variable on the horizontal axis and the PE variable on the vertical axis.

39
New cards

In 2019, The Walt Disney Company earned more than $11 billion worldwide with eight of the year's ten highest-grossing films, as depicted by the left-hand chart below. The right-hand chart shows the trajectory of Disney's domestic box-office sales, bolstered by a series of brilliant cinematic acquisitions such as Marvel Studios and Lucasfilm.

What plot types are represented in this data visualization?

Select TWO correct answers

-Bar plot

-Line graph

40
New cards

Consider the data in power_christmas.csv Download power_christmas.csv, which contains hourly data on the electrical grid load in Texas on Christmas day in each of three years: 2010, 2011, and 2012. Each row corresponds to a single hour. The three variables in this data frame are:

hour: hour of the day, where 0 = midnight, 12 = noon, 23 = 11 PM, etc

date: the calendar date of the data point. Three levels, corresponding to Christmas day in 2010, 2011, and 2012.

ERCOT: the hourly peak power demand on the ERCOT Links to an external site.grid during that hour

Use this data and ggplot() to make a line graph of peak power demand (y) versus hour of the day (x), faceted by date. Based on this plot, please select all accurate statements from those below.

-The highest single-hour peak demand in this data set occurred in 2012.

-2012 exhibits a different afternoon pattern than the other two years, because in that year peak demand continues to increase between hour=11 and hour=15.

-The lowest single-hour peak demand in this data set occurred in 2012.

41
New cards

Consider the following plot that shows the sepal width vs. sepal length for 50 individual flowers from each of 3 species of iris. The species are Iris setosa,versicolor, and virginica.

Which of the following statements about this plot is/are accurate? Select all correct answers

-The species of each flower has been mapped to the color of each point.

-The sepal width of each flower has been mapped to the vertical (y) location of each point.

42
New cards

The plot that we choose depends on the comparison we are trying to make and the type of data that we have:

The percentage of games won by each University of Texas women's soccer team in every season since the program was established in 1993.

Which of the following plots would be the best choice to display the trajectory of this measure over time?

Line graph

43
New cards

The colleges.csv Download colleges.csvdata set includes the following variables:

-PercentOnFinancialAid: Percentage of students that receive some financial aid at the institution

-AdmissionYield: Percentage of accepted applicants that decide to enroll at the institution

Which of the following plots would be the best choice to visualize the association between the PercentOnFinancialAid variable and the AdmissionYield variable?

Scatter plot

44
New cards

The colleges.csv Download colleges.csv data set includes the following variable:

-AdmissionYield: Percentage of accepted applicants that decide to enroll at the institution

Which of the following plots would be the best choice to visualize the distribution of the AdmissionYield variable?

Histogram

45
New cards

Which of the following plot design choices should generally be AVOIDED in data visualization? Select all correct answers.

-A barplot with truncated y-axis

-3D designs

46
New cards

The graphic seen above needs improvement for reasons that include which of the following?

(1) The use of a three-dimensional figure is distorting such that the "Apple" segment (19.5%) appears larger than the "Other" segment (21.2%).

(2) Colorblind individuals who may be in the audience may struggle to interpret the plot.

(3) The use of a legend rather than direct labeling of the segments asks the audience to repeatedly pivot back and forth from legend to plot when interpreting the graphic.

All of the above (1, 2, and 3)

47
New cards

The file greenbuildings.csv Download greenbuildings.csvcontains data on 7280 commercial real-estate properties. Each row refers to a single building. The two variables of interest here are the building's age (in years) and class (A/B/C, indicating the overall quality of the building). Use ggplot to create a faceted histogram of building ages, faceted by class. Use this histogram to determine which of the following statements is/are accurate. Choose all correct statements.

Note: you might find this easier if you make a density histogram Links to an external site..

Buildings in class A tend to be newer, relative to buildings in the other two classes.

Fewer than half the buildings in Class C are newer than 50 years old.

More than half the buildings in Class A are newer than 50 years old.

Buildings in Class C are older, on average, than buildings in Class A or B.

48
New cards

You earn a summer internship at an emerging start-up firm in the competitive smart phone market. On Day 1, you are asked to characterize the age distribution of new customers who have opened accounts during 2022. You use R to create the following summary table:

Age group Number of new accounts

Younger than 25 years 6770

25-34 years 10481

35-54 years 12495

55-64 years 9704

65 years and older 853

But of course you also want to include a visualization in your report. Which of the following plots would be the best choice to display the data in this table?

bar plot

49
New cards

The data in nobel_winners.csv Download nobel_winners.csvhas information on all Nobel Prizes awarded from 1901 through 2016. Make a side-by-side boxplot of the winners' ages (age_of_winner), stratified by gender. Use this plot to evaluate the statements below. Select all accurate statements.

-The youngest Nobel winner in this data set was female.

-Male Nobel winners have a higher median age.

50
New cards

Which of the following are among best practices for effective plots? Select all correct answers.

-Use faceting to show the same basic plot across multiple conditions.

-Present relevant comparisons and avoid irrelevant ones.

-Incorporate clear labels and annotations that help the viewer make sense of the graphic.

51
New cards

The plot below shows people's perceptions of probability associated with various English phrases. Specifically, survey respondents were asked to provide a numerical probability that they felt best corresponded to a given phrase, such as "Highly likely."

Which of the following is true of the plot below? Select all correct answers.

-The horizontal orientation of boxplots is effective because it makes it easy to read the phrase categories.

-Side-by-side boxplots are an effective plot design to display the distribution of a numerical variable (assigned probability) across different levels of a categorical variable (phrases representing perceptions of probability).

-The design choice to use a different color for every category is not effective in interpreting the data because the colors do not encode information useful for comparison.

52
New cards

The greenbuildings.csv Download greenbuildings.csvdata set contains data on thousands of commercial real-estate properties nationwide. The Rent variable is the rent charged to tenants in that building, in dollars per square foot per year.

What is the median rent in this data set?

$25.20

53
New cards

If the distribution of a numerical variable is unimodal and skewed to the left, then the median of the distribution is:

greater than the mean.

54
New cards

The data frame in marketing.csv Download marketing.csvcontains information on the impact of three advertising media on the unit sales of 200 different products:

-youtube: YouTube advertising budget ($ thousands)

-facebook: Facebook advertising budget ($ thousands)

-newspaper: Newspaper advertising budget ($ thousands)

-sales: sales volume (in thousands of units)

Which of the following is the q=0.90 quantile (or 90th percentile) of the youtube variable in this sample?

$313,728

55
New cards

The data frame in marketing.csv Download marketing.csvcontains information on the impact of three advertising media on the unit sales of 200 different products:

youtube: YouTube advertising budget ($ thousands)

facebook: Facebook advertising budget ($ thousands)

newspaper: Newspaper advertising budget ($ thousands)

sales: sales volume (in thousands of units)

Which of the following best describes the distribution of the newspaper variable?

skewed to the right

56
New cards

Which of the following statements about outliers is/are accurate? Select all correct answers.

-There is no generally accepted formal definition of what constitutes an outlier.

-If an outlier noticeably changes the results of your analysis, it's a good idea to report results both with and without the outlier included.

57
New cards

The data frame in marketing.csv Download marketing.csvcontains information on the impact of three advertising media on the unit sales of 200 different products:

-youtube: YouTube advertising budget ($ thousands)

-facebook: Facebook advertising budget ($ thousands)

-newspaper: Newspaper advertising budget ($ thousands)

-sales: sales volume (in thousands of units)

Which of the following is the q=0.90 quantile (or 90th percentile) of the facebook variable in this sample?

$52,224

58
New cards

The plot above (based on a dataset from Motor Trend magazine on the design and performance of 32 car types) displays the distribution of fuel consumption (in miles per gallon) by the number of forward gears on the automobile.

Which of the following can we conclude based on this plot?

(1) Cars with 5 gears get the highest median miles per gallon.

(2) Cars with 3 gears have the largest interquartile range.

(3) The maximum miles per gallon for cars with 3 gears is less than the minimum miles per gallon for cars with 4 gears.

None of the above

59
New cards

The greenbuildings.csv Download greenbuildings.csvdata set contains data on thousands of commercial real-estate properties nationwide. The Rent variable is the rent charged to tenants in that building, in dollars per square foot per year. What is the interquartile range (IQR) of rents in this data set?

$14.68

60
New cards

Hermione earned a score of 97 on her Arithmancy midterm exam, for which the average score was 88 points and the standard deviation was 6 points.

Lavender earned a score of 72 on her Astronomy midterm exam, for which the average score was 83 points and the standard deviation was 4 points.

Parvati earned a score of 85 on her Ancient Runes midterm exam, for which the average score was 80 points and the standard deviation was 7 points.

Which of these three midterm scores is most unusual/extreme?

Lavender's score in Astronomy is the most extreme.

61
New cards

Match the summary statistic below with its correct application as a measure of center or measure of variability for the distribution of a numerical variable.

Variance: Measure of variability

Standard deviation: Measure of variability

Interquartile range: Measure of variability

Mean: Measure of center

Median: Measure of center

62
New cards

The greenbuildings.csv Download greenbuildings.csvdata set contains data on thousands of commercial real-estate properties nationwide. The stories variable is the height of the building in stories. Based on this distribution, what is the z-score for a 33-story building?

1.58

63
New cards

The data frame in marketing.csv Download marketing.csvcontains information on the impact of three advertising media on the unit sales of 200 different products:

youtube: YouTube advertising budget ($ thousands)

facebook: Facebook advertising budget ($ thousands)

newspaper: Newspaper advertising budget ($ thousands)

sales: sales volume (in thousands of units)

Which of the following best describes the distribution of the sales variable?

approximately symmetric

64
New cards

Match the following data wrangling operation with its corresponding R function or feature.

-Select a subset of cases in a data frame that meet certain criteria: filter()

-Generate statistics to characterize sets of values: summarize()

-Alter the structure of a data frame: group_by()

-Add new variables to the data frame based on existing variables: mutate()

-Combine multiple operations into a single sequence: The pipe operator: %>%

65
New cards

In RStudio, load the dataset diamonds -- built-in to the tidyverse package -- by running the following commands in your R script:

library(tidyverse)data(diamonds)

The data set describes features of almost 54,000 diamonds, including the following variables:

price: price in U.S. dollars

carat: weight of the diamond

cut: the quality of the cut, from Fair to Ideal

color: a letter code indicating the color of the diamond

Which color of diamond in this data set has the highest median weight, in carats?

J

66
New cards

In RStudio, load the dataset diamonds -- built-in to the tidyverse package -- by running the following commands in your R script:

library(tidyverse)data(diamonds)

The data set describes features of almost 54,000 diamonds, including the following variables:

price: price in U.S. dollars

carat: weight of the diamond

cut: the quality of the cut, from Fair to Ideal

color: a letter code indicating the color of the diamond

What is the median weight (carat variable) for diamonds with a price of at least $10,000? Round your answer to two decimal places.

1.69

67
New cards

The data in olympics_top20.csv Download olympics_top20.csvcontains information on every Olympic medalist in the top 20 sports by participant count, all the way back to 1896. Use these data to answer the following question.

The 95th percentile of heights for female competitors in 'Athletics' events (i.e., track and field) is closest to which of the following?

Hint: Create a data frame that only contains cases that meet the above criteria for variables sex and sport. Then, calculate the 95th percentile.

183 centimeters

68
New cards

The data in olympics_top20.csv Download olympics_top20.csvcontains information on every Olympic medalist in the top 20 sports by participant count, all the way back to 1896. Use these data to answer the following:

Which single event in the 2012 London games had the heaviest median male competitor?

Hint: Create a data frame that only contains cases that meet the above criteria for the variables sex and year. Then create subgroups by the event variable.

Athletics Men's Shot Put

69
New cards

The data in olympics_top20.csv Download olympics_top20.csv contains information on every Olympic medalist in the top 20 sports by participant count, all the way back to 1896. Use these data to answer the following question.

Which single women's event had the greatest variability in competitor's heights across the entire history of the Olympics, as measured by the standard deviation?

Hint: Create a data frame that only contains cases that meet the above criteria for the variable sex. Then create subgroups by the event variable before calculating standard deviation for each.

Rowing Women's Coxed Fours

70
New cards

The data in olympics_top20.csv Download olympics_top20.csv contains information on every Olympic medalist in the top 20 sports by participant count, all the way back to 1896. Use these data to answer the following:

How has the average age of Olympic swimmers changed over time? Does the trend look different for male swimmers relative to female swimmers?

Create a data frame to visualize these groups over time, then plot the data with a line graph. Which of the following is true of this plot?

(1) The mean age of male and female swimmers has generally increased since the 1950s.

(2) After 1924, male swimmers are generally a few years older than female swimmers.

(3) The two groups had an approximately equal average age in the 2000 Summer Olympics.

All of the above (1, 2, and 3)

71
New cards

In RStudio, load the dataset diamonds -- built-in to the tidyverse package -- by running the following commands in your R script:

library(tidyverse)data(diamonds)

The data set describes features of almost 54,000 diamonds, including the following variables:

price: price in U.S. dollars

carat: weight of the diamond

cut: the quality of the cut, from Fair to Ideal

color: a letter code indicating the color of the diamond

The interquartile range of price for diamonds with an 'Ideal' cut is closest to which of the following?

$3,800

72
New cards

FiveThirtyEight published an analysis of patterns in Super Bowl television commercials from the ten brands that aired the most spots during 2000--2020. These data are in the superbowl.csv Download superbowl.csv file.

Run the following code to remove missing (NA) values from the YouTube view_count and like_count variables:

superbowl = superbowl %>%filter(!is.na(view_count), !is.na(like_count))

Then, use more data wrangling to answer the following.

Which brand has the lowest average view_count for Super Bowl ads in this sample?

Kia

73
New cards

FiveThirtyEight published an analysis of patterns in Super Bowl television commercials from the ten brands that aired the most spots during 2000--2020. These data are in the superbowl.csv Download superbowl.csv file.

Run the following code to remove missing (NA) values from the YouTube view_count and like_count variables:

superbowl = superbowl %>%filter(!is.na(view_count), !is.na(like_count))

Then, use more data wrangling to answer the following.

The median like_count for advertisements that feature animals is closest to which of the following?

118

74
New cards

The file billboard.csv Download billboard.csvcontains data on every song to appear on the weekly Billboard Top 100 chart during 1959 through 2020. Each row of this data frame corresponds to a single song in a single week. Variables include:

performer: who performed the song

song: the title of the song

year: year (1959 to 2020)

week: chart week of that year (1, 2, etc)

week_position: what position that song occupied that week on the Billboard top 100 chart.

Use your skills in data wrangling to make a table of the top 10 most popular songs in the data set, as measured by the total number of weeks that a song spent on the Billboard Top 100.

Which of the following performers appear in this table? Select all correct answers.

HINTS:

Your table should have 10 rows and 3 columns: (1) performer, song, and count, where count represents the number of weeks that song appeared in the Billboard Top 100.

Make sure the entries are sorted in descending order of the count variable, so that more popular songs appear at the top of the table.

You'll want to use both performer and song in any group_by() operations, to account for the fact that multiple unique songs can share the same title.

The n() function will be useful to generate counts.

-Carrie Underwood

-Adele

-AWOLNATION

-Imagine Dragons

75
New cards

Is the "musical diversity" of the Billboard Top 100 changing over time? Let's measure the musical diversity of given year as the number (count) of unique songs that appeared in the Billboard Top 100 that year. Use the code below to count the number of unique songs that appeared on the Top 100 in each year:

yearlycounts = billboard %>%

group_by(year, song, performer) %>%

summarize(n = n()) %>%

group_by(year) %>%

summarize(n=n())

After running the code above, you should have a new data frame in the RStudio data environment called "yearlycounts". Use this new data frame to make a line graph that plots the measure of musical diversity over the years. The x axis should show the year, while the y axis should show the number of unique songs (i.e., our calculated measure of musical diversity).

Based on your line graph, evaluate the statements below. Select all accurate statements.

-The year 2020 saw more than 800 unique songs on the Billboard Top 100 for the first time since before the 1970s.

-The 1960s had the greatest musical diversity relative to other decades.

-The time period that we observed with lowest musical diversity is around the year 2000.

76
New cards

The file nycflights13.csv Download nycflights13.csv contains data on all domestic flights departing the three major New York City area airports (LGA, JFK, and EWR) in 2013, including the following variables:

dest: flight destination airport

carrier: abbreviation representing commercial airline

sched_dep_time: hour of scheduled departure on a 24-hour clock

dep_delay: departure delay in minutes

distance: distance from origin to destination in miles

origin: flight origin airport (EWR, LGA, or JFK)

Wrangle the data to identify which airline (carrier) flew most often from the NYC area to San Antonio (dest == 'SAT')? How many flights did that carrier make from the NYC area to San Antonio in 2013? Enter your answer below.

330

77
New cards

The file nycflights13.csv Download nycflights13.csv contains data on all domestic flights departing the three major New York City area airports (LGA, JFK, and EWR) in 2013, including the following variables:

dest: flight destination airport

carrier: abbreviation representing commercial airline

sched_dep_time: hour of scheduled departure on a 24-hour clock

dep_delay: departure delay in minutes

distance: distance from origin to destination in miles

origin: flight origin airport (EWR, LGA, or JFK)

Let's define a "long-haul flight" as one with a distance exceeding 2500 miles. Wrangle the data to identify which of the three NYC airports (origin) had the most long-haul flights in 2013. How many long-haul flights originated at that airport in 2013? Enter your answer below.

9,471

78
New cards

The file nycflights13.csv Download nycflights13.csv contains data on all domestic flights departing the three major New York City area airports (LGA, JFK, and EWR) in 2013, including the following variables:

dest: flight destination airport

carrier: abbreviation representing commercial airline

sched_dep_time: hour of scheduled departure on a 24-hour clock

dep_delay: departure delay in minutes

distance: distance from origin to destination in miles

origin: flight origin airport (EWR, LGA, or JFK)

Suppose that you want to calculate the average departure delay in minutes (dep_delay) for Delta Airlines flights (carrier == 'DL') to Atlanta Hartsfield-Jackson (dest == 'ATL') scheduled to depart (sched_dep_time) after 8:00 AM.

Which of the following functions will you need to calculate this summary statistic for a subset of cases in the data frame? Select all appropriate functions for this objective.

-summarize()

-filter()

-mean()

79
New cards

Match the R function on the left to its primary purpose in fitting linear models on the right.

-lm: fit the model

-coef: print the estimated parameters of the model

-rsquared: calculate a measure of model fit

-resid: generate error terms for each observ data point

-geom_point: make a scatterplot

80
New cards

In a linear regression model, we describe data by an equation:

yi=β0+β1∗xi+ei

Which of the following is accurate for this equation? Select all correct answers.

-The predictor variable is represented by xi

-Model error is represented by ei

81
New cards

A store owner fits a linear model predicting daily sales revenue ($) from the number of customers who visited the store each day. The equation is:

Salesi=10.56+5.23⋅Customersi+ei

If 70 customers visit the shop tomorrow, the daily sales revenue predicted by this linear model is closest to which of the following?

$377

82
New cards

Which of the following are accurate statements about R2? Select all correct answers.

-R2 ranges from 0 to 1

-If a linear model produces a R2 equal to 0.77, it indicates that 23% of the variability in Y is predicted by factors other than variation in X

83
New cards

A data set used by a marketing team contains the following information on 46 different internet advertising campaigns:

total ad spend (measured in dollars of total advertising cost for that campaign)

visibility (measured in impressions for all ads across the campaign)

They fit a linear model to predict a campaign's visibility from its ad spend. What units does the slope have?

impressions per dollar

84
New cards

This is one of three questions about the data in creatinine.csv Download creatinine.csv. Each row represents a patient in a doctor's office. The variables are:

age: patient's age in years.

creatclear: patient's creatine clearance rate in mL/minute, a measure of kidney health (higher is better).

Fit a linear model that predicts a patient's creatine clearance rate in terms of their age. Use this model to answer the following question.

Which of the following statements about this model are correct? Choose all correct answers.

-About 67% of the total variation in patients' creatinine clearance rate can be predicted by their ages.

-The typical error made by this model, as measured by the residual standard deviation, is approximately 6.9 mL/min.

85
New cards

This is one of three questions about the data in creatinine.csv Download creatinine.csv. Each row represents a patient in a doctor's office. The variables are:

age: patient's age in years.

creatclear: patient's creatine clearance rate in mL/minute, a measure of kidney health (higher is better).

Fit a linear model that predicts a patient's creatine clearance rate in terms of their age. Use this model to answer the following question.

Which of the following model estimates represents the change in creatinine clearance rates that we expect to see as a function of age for this sample? (This number should have units mL/minute per year.)

-0.62

86
New cards

This is one of three questions about the data in creatinine.csv Download creatinine.csv. Each row represents a patient in a doctor's office. The variables are:

age: patient's age in years.

creatclear: patient's creatine clearance rate in mL/minute, a measure of kidney health (higher is better).

Fit a linear model that predicts a patient's creatine clearance rate in terms of their age. Use this model to answer the following question.

Based on this model, what creatinine clearance rate should we expect, on average, for a 55-year-old? Round your answer to the nearest whole number.

114

87
New cards

A data-science team at a large grocery chain observes the quantity of ice cream cartons sold at different levels of outside temperature each day. Their goal is to use a statistical model to understand how changes in temperature predict changes in consumer demand for ice cream, as measured by quantity sold on a given day. Select all correct answers below that describe this model.

-Quantity sold should be the response variable, and temperature should be the predictor variable.

-If the data scientists use a linear model, the model intercept represents, mathematically, what we'd expect ice cream sales quantity to be if the outside temperature was exactly 0.

88
New cards

This is one of multiple questions about the data in utsat.csv Download utsat.csv, which contains the SAT scores and graduating college GPAs for UT students. The relevant variables in this data set are:

SAT.V: score on the verbal section of the SAT (200-800)

SAT.Q: score on the quantitative section of the SAT (200-800)

SAT.C: combined SAT score

School: college or school at which the student first matriculated (not necessarily where they ended up)

GPA: college GPA upon graduation, on a 4-point scale

This data constitutes a census of a specific population: every UT student who entered UT in a specific recent year and went on to graduate from UT within 6 years. But what happens if we take samples from this population? Use the data the answer the following question.

Simulate 10,000 samples of size n=250 from this data set. Based on this Monte Carlo simulation, the standard error of the mean SAT Verbal score for a sample of size 250 is closest to which of the following?

5

89
New cards

Which of the following is true of standard error and the similar-sounding but conceptually different "margin of error"?

(1) The number referred to as the "margin of error" is not a characteristic of a particular sample but rather associated with the sampling procedure.

(2) The "margin of error" --- usually operationalized as one or two multiples of the standard error --- is a colloquial term without a fixed formal definition.

(3) The "margin of error" always means the same thing: it is the standard deviation of the sampling distribution.

1 and 2

90
New cards

A sampling distribution:

is the distribution of values of a summary statistic that we'd expect to see under repeated realizations of the same random data-generating process.

91
New cards

This is one of multiple questions about the data in utsat.csv Download utsat.csv, which contains the SAT scores and graduating college GPAs for UT students. The relevant variables in this data set are:

SAT.V: score on the verbal section of the SAT (200-800)

SAT.Q: score on the quantitative section of the SAT (200-800)

SAT.C: combined SAT score

School: college or school at which the student first matriculated (not necessarily where they ended up)

GPA: college GPA upon graduation, on a 4-point scale

This data constitutes a census of a specific population: every UT student who entered UT in a specific recent year and went on to graduate from UT within 6 years. But what happens if we take samples from this population? Use the data the answer the following question.

Simulate 10,000 samples of size n=50 from this data set. Based on this Monte Carlo simulation, the standard error of the mean GPA for a sample of size 50 is closest to which of the following?

0.07

92
New cards

This is one of multiple questions about the data in utsat.csv Download utsat.csv, which contains the SAT scores and graduating college GPAs for UT students. The relevant variables in this data set are:

SAT.V: score on the verbal section of the SAT (200-800)

SAT.Q: score on the quantitative section of the SAT (200-800)

SAT.C: combined SAT score

School: college or school at which the student first matriculated (not necessarily where they ended up)

GPA: college GPA upon graduation, on a 4-point scale

This data constitutes a census of a specific population: every UT student who entered UT in a specific recent year and went on to graduate from UT within 6 years. But what happens if we take samples from this population? Use the data the answer the following question.

Simulate 10,000 samples of size n=100 from this data set. Based on this Monte Carlo simulation, the standard error of the proportion of Business students represented in a sample of size 100 is closest to which of the following?

Hint: you might find this easier if you use mutate() to define a new binary variable to identify Business students.

0.04

93
New cards

Match the definitions below with their appropriate concept / term.

-some aspect of the world about which we'd like to learn using data: estimand

-a summary statistic designed to estimate some aspect of the world about which we'd like to learn using data: estimator

-use of statistical computing to repeatedly simulate the random process that generated our data: Monte Carlo simulation

-the average value of a summary statistic under repeated sampling from the same random process that generated our original sample: expected value

-the standard deviation of a sampling distribution: standard error

-data for the entire population of interest: census

94
New cards

Match the following R commands with their appropriate use.

-Computes the sample proportion for a binary (yes/no) variable: prop

-Repeatedly execute the same statement/s many times: do

-Take a random sample of rows from a data frame: sample

-Simulate a sequence of binary events and count the number of "yes" outcomes: nflip

95
New cards

The data in the CPS85.csv Download CPS85.csvfile are from the 1985 Current Population Survey (CPS), which is used to supplement U.S. census information between census years. The data frame is a random sample of people living in the U.S. for whom we have information on wages and other characteristics, including sex, number of years of education, years of work experience, occupational status, region of residence, and union membership status.

Consider the wage variable, which refers to the hourly wage (in nominal 1985 dollars) of each respondent. Form a bootstrap sampling distribution, using at least 10,000 bootstrap samples, for the mean wage of respondents. The bootstrap standard error of the mean wage is closest to which of the following?

0.2

96
New cards

This is one of multiple questions about the data in CPS85.csv Download CPS85.csv. This data is from the 1985 Current Population Survey (CPS), which is used to supplement U.S. census information between census years. These data consist of a random sample of people living in the U.S., with information on wage and other characteristics of the workers, including sex, number of years of education, years of work experience, occupational status, region of residence and union membership.

Consider the married variable, which indicates whether someone is married or single. Form a bootstrap sampling distribution, using at least 10,000 bootstrap samples, for the proportion of respondents who are married. Use this sampling distribution to select which of the following statements is/are true. Select all accurate statements.

Note: you might get numbers that differ from our numbers by a few tenths of a percentage point. This is down to Monte Carlo variability. So if a statement looks basically correct but the numbers are slightly different in that third decimal place, mark it as correct. We are not trying to trick you with subtle differences in rounding.

-The standard error for the proportion of married respondents in this sample is about 0.02, or 2%.

-We're 95% confident that the proportion of married individuals in the wider U.S. population is somewhere between about 61.5% and 69.5%.

97
New cards

Which of the following represent(s) the concept of "sampling WITH replacement"?

Select all correct answers.

Professor Snape selects a sample of students to "cold call" during each of his NEWT-level Potions classes. For each question, he uses a Resampulus charm, wherein his wand randomly points to a student irrespective of who was called previously. There is no limit on the number of times that an individual student might be selected during any given class session.

98
New cards

The data in the CPS85.csv Download CPS85.csv file are from the 1985 Current Population Survey (CPS), which is used to supplement U.S. census information between census years. The data frame is a random sample of people living in the U.S. for whom we have information on wages and other characteristics, including sex, number of years of education, years of work experience, occupational status, region of residence, and union membership status.

Consider the union variable, which indicates whether someone is in a union or not. Form a bootstrap sampling distribution, using at least 10,000 bootstrap samples, for the proportion of respondents who are not in a union in this sample. Use this to form a 95% confidence interval for the proportion of Americans who are NOT in a union:

Lower bound closest to: 0.79

Upper bound closest to: 0.85

Answer 1: 0.79

Answer 2: 0.85

99
New cards

The data in the CPS85.csv Download CPS85.csvfile are from the 1985 Current Population Survey (CPS), which is used to supplement U.S. census information between census years. The data frame is a random sample of people living in the U.S. for whom we have information on wages and other characteristics, including sex, number of years of education, years of work experience, occupational status, region of residence, and union membership status.

Consider the wage variable, which refers to the hourly wage (in nominal 1985 dollars) of each respondent. Form a bootstrap sampling distribution, using at least 10000 bootstrap samples, for the MEDIAN wage of CPS survey respondents. Use this to form a 95% confidence interval for the MEDIAN wage in the wider population:

Lower bound closest to: 7.4

Upper bound closest to: 8.5

Answer 1: 7.4

Answer 2: 8.5

100
New cards

The Austin City Council conducted a random sample of Austin residents on whether or not they approve of the upcoming 8.75-cent tax rate election to fund a mass transit plan including light rail, new bus routes, and a downtown subway system. Of the 1734 Austinites in the random sample, 51% approved of the plan. The standard error of this estimate was 1.25%, and the margin of error was set to be plus-or-minus two standard errors (2.5%). Which of the following may we conclude from this analysis?

(1) Of Austinites in the overall population, 51% approve of the mass transit plan.

(2) We are 100% certain, in light of the survey, that the proportion of the overall population of Austinites who approve of the transit plan is between 48.5% - 53.5%.

(3) Nothing useful, because a random sample size of 1734 respondents is not sufficient to give us reliable insight about the approval rate in the overall population of more than a million people.

None of the above