{"id":16146844,"url":"https://github.com/antoinesoetewey/statistics-202","last_synced_at":"2026-05-26T01:00:33.526Z","repository":{"id":38411912,"uuid":"223914459","full_name":"AntoineSoetewey/statistics-202","owner":"AntoineSoetewey","description":"Shiny app for simple linear regression by hand.","archived":false,"fork":false,"pushed_at":"2026-05-18T11:28:22.000Z","size":112,"stargazers_count":5,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-05-18T13:17:11.367Z","etag":null,"topics":["linear-regression","r","shiny","statistics"],"latest_commit_sha":null,"homepage":"https://antoinesoetewey.shinyapps.io/statistics-202/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AntoineSoetewey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"AntoineSoetewey","custom":["https://www.buymeacoffee.com/statsandr","https://www.paypal.com/donate/?hosted_button_id=TUVCTTX838UC2","https://statsandr.com/support/"]}},"created_at":"2019-11-25T09:50:30.000Z","updated_at":"2026-05-18T11:28:27.000Z","dependencies_parsed_at":"2024-10-27T18:26:03.610Z","dependency_job_id":"f8170743-0b18-4c8a-a874-5a64e2067d0e","html_url":"https://github.com/AntoineSoetewey/statistics-202","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AntoineSoetewey/statistics-202","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineSoetewey%2Fstatistics-202","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineSoetewey%2Fstatistics-202/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineSoetewey%2Fstatistics-202/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineSoetewey%2Fstatistics-202/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AntoineSoetewey","download_url":"https://codeload.github.com/AntoineSoetewey/statistics-202/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntoineSoetewey%2Fstatistics-202/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33499282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linear-regression","r","shiny","statistics"],"created_at":"2024-10-10T00:22:10.764Z","updated_at":"2026-05-26T01:00:33.514Z","avatar_url":"https://github.com/AntoineSoetewey.png","language":"R","funding_links":["https://github.com/sponsors/AntoineSoetewey","https://www.buymeacoffee.com/statsandr","https://www.paypal.com/donate/?hosted_button_id=TUVCTTX838UC2","https://statsandr.com/support/"],"categories":[],"sub_categories":[],"readme":"# statistics-202 — Simple Linear Regression\n\nA Shiny app for performing simple linear regression both by hand and in R.\n\n**Live app:** https://antoinesoetewey.shinyapps.io/statistics-202/\n\n**Blog post:** https://statsandr.com/blog/a-shiny-app-for-simple-linear-regression-by-hand-and-in-r/\n\n---\n\n## Purpose and overview\n\nThis app is designed to help students understand and perform simple linear regression. Given a set of paired observations for two numeric variables ($x$ and $y$), the app estimates the regression line, displays step-by-step formulas for computing the coefficients by hand, and provides full R output alongside an interactive plot. It is intended as both a learning tool and a computation aid for introductory statistics courses.\n\n---\n\n## Key features\n\n- **Data input** — Enter $x$ and $y$ values directly as comma-separated lists. Summary statistics (means and sample size) are displayed automatically.\n- **By-hand computation** — Shows the OLS formulas for the slope ($\\hat{\\beta}_1$) and intercept ($\\hat{\\beta}_0$) with the computed values filled in, so students can follow each calculation step.\n- **R output** — Displays the full `lm()` summary, including coefficient estimates, standard errors, t-statistics, p-values, $R^2$, and the F-statistic.\n- **Interactive regression plot** — Renders a scatter plot with the fitted regression line via `ggplot2` and `plotly`. An optional confidence interval band can be toggled on or off.\n- **Automatic interpretation** — Provides a plain-language interpretation of the estimated coefficients based on their statistical significance ($\\alpha = 0.05$), including appropriate caveats.\n- **Assumption checks** — A collapsible section displays the standard linear regression diagnostic plots (linearity, homoscedasticity, normality of residuals, influential observations) generated by the `performance` package.\n- **Downloadable report** — Exports a self-contained HTML report (via R Markdown) that reproduces the analysis, with an option to include or hide the underlying R code.\n\n---\n\n## Running the app locally\n\n**Prerequisites:** R ($\\ge 4.0$) and the following packages:\n\n```r\ninstall.packages(c(\n  \"shiny\",\n  \"shinythemes\",\n  \"ggplot2\",\n  \"plotly\",\n  \"DT\",\n  \"rmarkdown\",\n  \"knitr\",\n  \"pander\",\n  \"performance\",\n  \"see\"\n))\n```\n\n**Launch the app:**\n\n```r\nshiny::runGitHub(\"statistics-202\", \"AntoineSoetewey\")\n```\n\nOr clone the repository and run locally:\n\n```r\n# In the project directory\nshiny::runApp()\n```\n\n---\n\n## Dependencies\n\n| Package | Role |\n|---|---|\n| `shiny` | Web application framework |\n| `shinythemes` | UI theme (Flatly) |\n| `ggplot2` | Regression plot |\n| `plotly` | Interactive plot rendering |\n| `DT` | Interactive data table with export buttons |\n| `rmarkdown` / `knitr` | Report generation |\n| `pander` | Report formatting |\n| `performance` / `see` | Regression assumption diagnostic plots |\n\n---\n\n## Part of a set of complementary Shiny apps\n\nThis app is part of a set of three complementary Shiny apps developed for students while the author was a teaching assistant at UCLouvain. All three apps are still actively used when teaching introductory statistics and probability courses.\n\n- **statistics-101** — compute probabilities for the main probability distributions: https://github.com/AntoineSoetewey/statistics-101\n- **statistics-201** — perform statistical inference on mean(s), proportion(s), and variance(s): https://github.com/AntoineSoetewey/statistics-201\n- **statistics-202** — simple linear regression by hand: https://github.com/AntoineSoetewey/statistics-202 (this app)\n\n## License\n\nThis project is licensed under the terms of the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoinesoetewey%2Fstatistics-202","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantoinesoetewey%2Fstatistics-202","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantoinesoetewey%2Fstatistics-202/lists"}