The goal of this course is to introduce students to linear regression analysis with an emphasis on application in the programming language R. The emphasis is primarily on conceptual understanding of statistical modeling, intuitive interpretation/visualization of results, and evaluation of the quality of the analysis. The first half of the course introduces tools for creating and interpreting regression models. In the second half of the course, we will discuss what the assumptions of linear regression do, what they are for, and what to do when our model does not meet them. In addition to good practice, we'll also review common mistakes and how to avoid them.
Graduates of the course will be able to perform statistical analysis using linear regression from start to finish - from selecting variables to analyze, to building and checking the model, to interpreting and visualizing it. Above all, they will gain the knowledge necessary to defend the decisions they make in statistical data analysis. Not only will they be able to defend the conclusions of their analyses to an audience, but they will (hopefully) increase their confidence in their own analytical abilities.
The course assumes a basic understanding of statistics (at the level of the Statistics 2 course) and the R programming language (at the level of Introduction to Data Analysis in R).
Last update: Mgr. Aleš Vomáčka (08.02.2024)
Cílem toho kurzu je seznámit studenty s lineární regresní analýzou s důrazem na aplikaci v programovacím jazyce R. Důraz je kladen primárně na konceptuální pochopení statistického modelování, intuitivní interpretaci/vizualizaci výsledků a hodnocení kvality analýzy. V první polovině kurzu se seznámíme s nástroji pro vytváření a interpretaci regresních modelů. V druhé části kurzu si popovídáme o tom, jaké předpoklady lineární regrese dělá, k čemu jsou a co dělat, když je náš model nesplňuje. Kromě dobré praxe si ukážeme také časté chyby a jak se jim vyhnout.
Absolventi kurzu budou schopní provést statistickou analýzu pomocí lineární regrese od začátku do konce - od výběru proměnných k analýze, přes vytvoření a kontrolu modelu, až po jeho interpretaci a vizualizaci. Především ale získají znalosti nezbytné k obhájení rozhodnutí, které v rámci statistické analýzy dat dělají. Nejen, že budou schopni obhájit závěry svých analýz před publikem, ale zvýší (snad) i důvěru ve své vlastní analytické schopnosti.
Kurz předpokládá základní znalosti statistiky (na úrovni kurzu Statistika 2) a programovacího jazyka R (na úrovni Úvodu do analýzy dat v R).
Course completion requirements -
Last update: Mgr. Petra Poncarová (18.05.2023)
To succesfuly complete this course, students are required to do the following:
Pick a dataset featured on the TidyTuesday project (any year).
Formulate a research problem related to the data. This research problem can be either predictive or inferential in nature (e.g. Can we predict the popularity of a song on Spotify based on its characteristics? Does the gender wage gap in the US depend on the proportion of women in the field? Are more expensive video games rated better?).
Analyze the data using a linear regression model and write a report on your findings. This report should include clear definition of your research problems, description of your data (including descriptive statistics), description of your regression model (both tables and graphs where appropriate), diagnostics of your regression model and overall conclusion. You can transform and filter data as necessary, but clearly describe all data transformations. Prepare two documents for submission: (1) a script which must be fully operational: it has to run without error from start (including downloading data from TidyTuesday website) to finish without any need for outside interference and produce all analytic outputs (models, charts) used for the assignment, (2) final report (e.g. Word or Pdf) as described above. If you get stuck don’t be afraid to ask for a consultation.
Last update: Mgr. Petra Poncarová (18.05.2023)
K úspěšnému absolvování tohoto kurzu jsou studenti povinni udělat následující:
Vybrat datový soubor uvedený v projektu TidyTuesday (libovolný rok).
Formulovat výzkumný problém související s daty. Tento výzkumný problém může být buď prediktivní, nebo inferenční povahy (např. Můžeme predikovat popularitu písně na Spotify na základě jejích charakteristik? Závisí rozdíl ve mzdách mužů a žen v USA na podílu žen v oboru? Jsou dražší videohry hodnoceny lépe?).
Analyzujte data pomocí lineárního regresního modelu a napište zprávu o svých zjištěních. Tato zpráva by měla obsahovat jasnou definici vašich výzkumných problémů, popis vašich dat (včetně popisné statistiky), popis vašeho regresního modelu (případně jak tabulek, tak grafů), diagnostiku vašeho regresního modelu a celkový závěr. Data můžete transformovat a filtrovat podle potřeby, ale jasně popsat všechny datové transformace.
Připravte si dva dokumenty k odevzdání: (1) skript, který musí být plně funkční: musí běžet bez chyb od začátku (včetně stahování dat z webu TidyTuesday), dokončit bez potřeby vnějších zásahů a vytvořit všechny analytické výstupy (modely, grafy) použité pro zadání, (2) závěrečnou zprávu (např. Word nebo Pdf) jak je popsáno výše.
Oba dokumenty zašlete na emailovou adresu, kterou vám sdělíme na kurzu. Termín bude také sdělen na kurzu. Pokud se zaseknete, nebojte se požádat o konzultaci.
Harrell, F. (2001). Regression Modeling Strategies: With Applications to Linear Models, Logistic Regression, and Survival Analysis. Springer-Verlag. https://doi.org/10.1007/978-1-4757-3462-1
Secondary literature
Cole, S. R., Platt, R. W., Schisterman, E. F., Chu, H., Westreich, D., Richardson, D., & Poole, C. (2010). Illustrating bias due to conditioning on a collider. International Journal of Epidemiology, 39(2), 417–420. https://doi.org/10.1093/ije/dyp334
Cook, R. D. (1977). Detection of Influential Observation in Linear Regression. Technometrics, 19(1), 15–18. https://doi.org/10.2307/1268249
Fox, J. (2015). Applied Regression Analysis and Generalized Linear Models (Third edition). SAGE Publications, Inc.
Greenland, S., Senn, S. J., Rothman, K. J., Carlin, J. B., Poole, C., Goodman, S. N., & Altman, D. G. (2016). Statistical tests, P values, confidence intervals, and power: A guide to misinterpretations. European Journal of Epidemiology, 31(4), 337–350. https://doi.org/10.1007/s10654-016-0149-3
King, G., & Roberts, M. E. (2015). How Robust Standard Errors Expose Methodological Problems They Do Not Fix, and What to Do About It. Political Analysis, 23(2), 159–179.
Shmueli, G. (2010). To Explain or To Predict? (SSRN Scholarly Paper ID 1351252). Social Science Research Network. https://doi.org/10.2139/ssrn.1351252