🌍 Week 3 Homework — Feedback
🌍 Week 3 Homework — Feedback
Student: Lorenzo [surname missing]
Files: w3ass.m, rgdp_all.csv
Assignment: World Bank Real GDP & Growth (CSV version)
⚠️ Overall Assessment
Result: ⚠️ Partially correct
The submission includes both the script and the dataset, but they were placed in different folders, so the code did not initially run until the CSV was moved into the same directory.
Once corrected, the script executes some results but the growth numbers seem to be wrong.
🔍 Task-by-Task Check (Slides Tasks 1–8)
| Task | Description | Status | Notes |
|---|---|---|---|
| 1 | Import NY.GDP.MKTP.KD (real GDP) from CSV |
✅ | Correct import, once the CSV is in the same folder as the script. |
| 2 | Inspect & extract (country/iso3, year, value) | ✅ | Works as intended. |
| 3 | Build tidy table (country/iso3, year, value) |
✅ | Properly structured data frame. |
| 4 | Compute logs & annual growth | ⚠️ | Log-difference computation correctly implemented but the growth numbers seem to be wrong. |
| 5 | Verify US growth vs Week 1 | ❌ | US series not verified. |
| 6 | Plot Real GDP for selected countries + legend | ✅ | Levels plotted correctly. |
| 7 | Plot growth rates (subplots + average line) | ⚠️ | Plots correct data but uses a single axes; add subplots and mean lines for full compliance. |
| 8 | Export CSV panel with growth | ✅ | Correctly exported (name may differ from spec, acceptable). |
💬 Comments & Recommendations
- ✅ Code structure is logical and easy to follow.
- Remember to put the data file in the same folder as the script or to use relative paths and tell me your surname!
- ⚠️ File organisation: avoid splitting your data and script into separate folders unless paths are explicitly handled with
fullfile(). - ⚠️ Add semicolons at the end of statements to suppress unnecessary console output.
- ⚠️ Rename your script to follow the standard format:
week3_homework_solution.m. - ⚠️ Add relative paths to make the script fully reproducible: ```matlab opts = detectImportOptions(‘rgdp_all.csv’); T = readtable(‘rgdp_all.csv’, opts);