HW 5 Rubric
Rubric
This is the rubric for AI feedback, not necessarily the rubric for grading.
Part 1 - Crawling babies
Question 1
Part (a) - Code creates a scatterplot using
geom_point().Part (a) - Code maps temperature to the x-axis and average crawling age to the y-axis.
Part (a) - Plot has informative and human-readable axis labels.
Part (a) - Plot has an informative and human-readable title.
Part (b) - Narrative correctly describes the direction, strength, and form of the relationship in context.
Part (b) - Narrative correctly identifies the unusual observation in context.
Part (c) - Code correctly calculates and displays the correlation between
temperatureandavg_crawling_age.Code style and readability: line breaks after each
|>and+, appropriate indentation, spaces around=signs, and spaces after commas.- Note: Indentation with two spaces, four spaces, or tabs is acceptable.
Code smell: All code uses appropriate tidyverse functions and syntax.
Question 2
Part (a) - Code correctly creates
temperature_Cusing(temperature - 32) * 5/9and saves it in the data frame.Part (b) - Code correctly creates
avg_crawling_age_monthsusingavg_crawling_age / 4.345and saves it in the data frame.Part (c) - Narrative correctly describes how the scatterplot would change after converting units.
Part (c) - Narrative correctly describes how the correlation would change after converting units and provides an appropriate explanation.
Part (d) - Code creates a scatterplot using
geom_point().Part (d) - Code maps
temperature_Cto the x-axis andavg_crawling_age_monthsto the y-axis.Part (d) - Plot has informative and human-readable axis labels.
Part (d) - Plot has an informative and human-readable title.
Part (d) - Narrative compares the new scatterplot with the expectation in part (c) and provides a correct explanation.
Part (e) - Code correctly calculates and displays the correlation between the converted variables.
Part (e) - Narrative correctly compares the calculated correlation with the expectation in part (c).
Code style and readability: line breaks after each
|>and+, appropriate indentation, spaces around=signs, and spaces after commas.- Note: Indentation with two spaces, four spaces, or tabs is acceptable.
Code smell: All code uses appropriate tidyverse functions and syntax.
Part 2 - Life expectancy
Question 3
Part (a) - Code creates a scatterplot using
geom_point().Part (a) - Code maps meat consumption to the x-axis and life expectancy to the y-axis.
Part (a) - Plot has informative and human-readable axis labels.
Part (a) - Plot has an informative and human-readable title.
Part (a) - Narrative correctly describes the direction, strength, and form of the relationship in context.
Part (b) - Code creates a scatterplot using
geom_point().Part (b) - Code maps carbohydrate consumption to the x-axis and life expectancy to the y-axis.
Part (b) - Plot has informative and human-readable axis labels.
Part (b) - Plot has an informative and human-readable title.
Part (b) - Narrative correctly describes the relationship in context.
Part (c) - Narrative correctly identifies which plot appears to show the stronger correlation and provides an appropriate explanation.
Part (d) - Code correctly calculates and displays both correlations, handling missing observations appropriately.
Part (d) - Narrative compares the correlations’ magnitudes and correctly explains whether they support the expectation from part (c).
Code style and readability: line breaks after each
|>and+, appropriate indentation, spaces around=signs, and spaces after commas.- Note: Indentation with two spaces, four spaces, or tabs is acceptable.
Code smell: All code uses appropriate tidyverse functions and syntax.
Grading note: Four countries are missing meat or carbohydrate consumption, so ggplot2 warns that 4 rows were removed. Do not penalize this warning.
Question 4
Part (a) - Code fits a linear regression with
life_0as the response andmeatas the predictor using theyoudata.Part (a) - Linear regression uses tidymodels functions, e.g.,
linear_reg()andfit().Part (a) - Code displays the model coefficients using
tidy().Part (b) - Narrative provides correct interpretation of the slope in context of the data.
- Includes “each additional kg per capita per year” of meat consumption or an equivalent, consistently rescaled increment.
- Includes “on average” or similar language.
- Includes the correct value with units.
- All else correct.
Part (c) - Narrative provides correct interpretation of the intercept in context of the data.
- Includes 0 for the predictor value.
- Includes “on average” or similar language.
- Includes the correct value with units.
- All else correct.
Part (c) - Narrative states that the intercept is meaningful and provides correct justification.
Part (d) - Response identifies a country in the data and its meat consumption and observed life expectancy.
Part (d) - Code uses
augment()to obtain the prediction for the chosen country.Part (d) - Predicted life expectancy is correct for the chosen country and fitted model.
Part (d) - Residual is correctly calculated as observed minus predicted life expectancy, in years.
Part (d) - Narrative correctly states whether the model over- or under-predicts for the chosen country.
Code style and readability: line breaks after each
|>and+, appropriate indentation, spaces around=signs, and spaces after commas.- Note: Indentation with two spaces, four spaces, or tabs is acceptable.
Code smell: All code uses appropriate tidyverse functions and syntax.
Grading notes: Accept a rescaled predictor increment if the stated change is scaled consistently. Do not penalize an incorrect model estimate again when a subsequent interpretation or calculation is otherwise correct for the student’s displayed model.
Question 5
Part (a) - Code fits a linear regression with
life_0as the response andcho_cropsas the predictor using theyoudata.Part (a) - Linear regression uses tidymodels functions, e.g.,
linear_reg()andfit().Part (a) - Code displays the model coefficients using
tidy().Part (b) - Narrative provides correct interpretation of the slope in context of the data.
- Includes “each additional kg per capita per year” of carbohydrate consumption or an equivalent, consistently rescaled increment.
- Includes “on average” or similar language.
- Includes the correct value with units.
- All else correct.
Part (c) - Narrative provides correct interpretation of the intercept in context of the data.
- Includes 0 for the predictor value.
- Includes “on average” or similar language.
- Includes the correct value with units.
- All else correct.
Part (c) - Narrative states that the intercept is not meaningful and provides correct justification.
Part (d) - Code correctly calculates and displays R-squared.
Part (d) - Narrative provides a correct interpretation of R-squared in context of the data.
Part (e) - Code uses
augment()to obtain predicted values and residuals.Part (e) - Predicted values and residuals are correct for the fitted model.
Part (e) - Code creates a scatterplot using
geom_point(). A horizontal line at zero is optional.Part (e) - Code maps predicted life expectancy to the x-axis and residuals to the y-axis.
Part (e) - Plot has informative and human-readable axis labels.
Part (e) - Plot has an informative and human-readable title.
Part (e) - Narrative correctly describes the residual plot and assesses whether a linear model is a good fit for the data.
Code style and readability: line breaks after each
|>and+, appropriate indentation, spaces around=signs, and spaces after commas.- Note: Indentation with two spaces, four spaces, or tabs is acceptable.
Code smell: All code uses appropriate tidyverse functions and syntax.
Grading notes: Slope and intercept interpretations must convey an average or predicted response, rather than a guaranteed outcome for each country. Accept consistently rescaled slope interpretations, and do not penalize a model error again in otherwise correct follow-up interpretations.
Question 6
- Narrative correctly assesses whether the models support causal conclusions in context of the data.
Part 3 - Modeling the Old North State
Question 7
Code reads
nc-places.csvintonc_placesandnc-county.csvintonc_counties.Code correctly joins the data frames by county name and saves the result as
nc_counties_places. An inferred join on the sole shared column,county, is acceptable, as are other join types producing the same correct result for these data.Response correctly reports the number of rows and columns in the joined data frame: 100 rows and 67 columns.
- Note:
nc_countieshas 22 columns andnc_placeshas 46, sharing onlycounty. A different count likely indicates joining on the wrong column(s); don’t penalize the same error again.
- Note:
Code style and readability: line breaks after each
|>and+, appropriate indentation, spaces around=signs, and spaces after commas.- Note: Indentation with two spaces, four spaces, or tabs is acceptable.
Code smell: All code uses appropriate tidyverse functions and syntax.
Question 8
Response clearly identifies a numeric outcome variable and correctly states its original data frame.
Narrative explains why the outcome is interesting to predict and why prediction is sensible in this context.
Response clearly identifies a numeric predictor and correctly states its original data frame.
Narrative gives a plausible explanation of how the numeric predictor might relate to the outcome and why it could be useful for prediction.
Response clearly identifies a categorical predictor and correctly states its original data frame.
Narrative gives a plausible explanation of how the categorical predictor might relate to the outcome and why it could be useful for prediction.
Response correctly states the categorical predictor’s reference level. If the level order is changed, the code implements that change consistently with the stated reference.
Two selected variables originate in one data frame and the third originates in the other. A variable shared by both original data frames cannot by itself demonstrate use of information from the other source.
Grading note: Choices need not match the key. Grade the suitability of the variables and the reasoning, rather than requiring a strong observed relationship. Reordering factor levels is optional.
Question 9
Part (a) - Code fits a linear regression with the Question 8 outcome as the response and the chosen numeric variable as the sole predictor, using
nc_counties_places.Part (a) - Linear regression uses tidymodels functions, e.g.,
linear_reg()andfit().Part (b) - Code displays the model coefficients using
tidy().Part (c) - Narrative provides correct interpretation of the slope in context of the data.
- Includes “each additional unit” of the chosen numeric predictor, with the predictor and its units identified. A consistently rescaled increment is acceptable.
- Includes “on average” or similar language.
- Includes the correct value with units.
- All else correct.
Part (d) - Narrative provides correct interpretation of the intercept in context of the data.
- Includes 0 for the predictor value.
- Includes “on average” or similar language.
- Includes the correct value with units.
- All else correct.
Part (d) - Narrative correctly states whether the intercept is meaningful and provides correct justification.
Part (e) - Code correctly calculates and displays the model’s R-squared.
Part (e) - Narrative provides a correct interpretation of R-squared in context of the data.
Code style and readability: line breaks after each
|>and+, appropriate indentation, spaces around=signs, and spaces after commas.- Note: Indentation with two spaces, four spaces, or tabs is acceptable.
Code smell: All code uses appropriate tidyverse functions and syntax.
Grading notes: Grade against the student’s chosen variables and fitted model, rather than requiring the key’s variables or estimates. Accept a meaningful rescaled predictor increment when the slope is scaled consistently. For an outcome measured as a percentage, distinguish percentage-point changes from percent changes. Avoid penalizing the same model error again in subsequent interpretations.
Question 10
Part (a) - Code fits a linear regression with the Question 8 outcome as the response and the chosen categorical variable as the sole predictor, using
nc_counties_places. The predictor is treated as categorical.Part (a) - Linear regression uses tidymodels functions, e.g.,
linear_reg()andfit().Part (b) - Code displays the model coefficients using
tidy(), with the appropriate reference level and a coefficient for each non-reference level.Part (c) - Narrative provides correct interpretation of the category coefficients in context of the data.
Includes the correct comparison between each non-reference category and the reference category.
Includes “on average” or similar language.
Includes the correct value with units.
All else correct.
Note: Apply each sub-item across all non-reference coefficients; award partial credit when only some are correct.
Part (d) - Narrative provides correct interpretation of the intercept in context of the data.
- Includes the correct reference category (all indicator variables equal 0).
- Includes “on average” or similar language.
- Includes the correct value with units.
- All else correct.
Part (d) - Narrative correctly states whether the intercept is meaningful and provides correct justification.
Part (e) - Code correctly calculates and displays the model’s R-squared.
Part (e) - Narrative provides a correct interpretation of R-squared in context of the data.
Code style and readability: line breaks after each
|>and+, appropriate indentation, spaces around=signs, and spaces after commas.- Note: Indentation with two spaces, four spaces, or tabs is acceptable.
Code smell: All code uses appropriate tidyverse functions and syntax.
Grading notes: Choices and reference levels need not match the key. Grade interpretations against the student’s displayed model and reference level. For an outcome measured as a percentage, coefficient differences are in percentage points. Avoid penalizing the same model error again in subsequent interpretations.
Overall
These rubric items are not tied to a specific question but apply to the entire homework. Check for these if explicitly asked to provide overall feedback or if you notice them while reviewing the homework or as the student is finishing up working on the last question.
Rubric
Final .qmd and rendered PDF files exist in the remote GitHub repository.
At least three commits were made and pushed to the GitHub repository, and the submission is reasonably organized.
An AI-use disclosure states whether an LLM or generative AI tool was used (Yes or No).
If AI was used, the disclosure describes all the ways it was used.
If AI was used, the disclosure lists all tools used, including model names and versions if known.
Any non-AI sources used are cited, with the question(s) for which each source was used.