Skip to content

MetzgerSK/shinyAdvReg

Repository files navigation

shinyAdvReg

For an identical version of this readme that has the repo's contents hidden: https://MetzgerSK.github.io/shinyAdvReg

This repository houses various Shiny apps I've written for regression models typically taught in a MLE/GLM course. Apps will get added as I finish writing and cleaning up the code, so check back from time to time.

By being in a GitHub repo, the apps can be run directly via Binder using the links below. Other than clicking the link and waiting <~60 seconds, there's nothing additional you need to install or do.

➡️ TL;DR: Click Launch Rstudio Binder to launch an app.

The Apps

Binary DV

  • mleLogit   Launch Rstudio Binder

See shinyElements/mleLogit

  • lp_hetOV✏️   Launch Rstudio Binder
    Examines the impact of (a) omitting a relevant covariate and/or (b) heteroskedastic errors on the estimates from binary models. Features basic logit/probit models, as well as heteroskedastic logit/probit models.
  • heatmapFit   Launch Rstudio Binder
    Convenience UI for heatmapFit package, as discussed in Esarey and Pierce's "Assessing Fit Quality and Testing for Misspecification in Binary-Dependent Variable Models" (2012, Political Analysis). User uploads dataset with predicted probabilities and observed 0/1 DV, and in return, the app outputs the heatmap fit statistic and the associated plot (plus an option to export the plot). Written with Stata users in mind.

Ordinal DV

  • mleOlogit   Launch Rstudio Binder
    Focuses on the intuition behind maximum likelihood using an ordered logit model. Students manually find the maximum of the model's likelihood function for a toy set of data. mleOlogit displays two graphs with the proposed best-fit line and fake data, and this line updates as students select different slope + cutpoint values.
  • ord_mnl 📘✏️   Launch Rstudio Binder
    Examines the ramifications of estimating an ordered logit model using truly nominal data, and a multinomial logit model using truly ordinal data.

Nominal DV

  • mleMNL   Launch Rstudio Binder
    Focuses on the intuition behind maximum likelihood using a multinomial logit model. Students manually find the maximum of the model's likelihood function for a toy set of data with three categories. mleMNL displays two graphs with the proposed best-fit line and fake data for Category A and Category B, and these lines update as students select different intercept + slope values for each category.
  • ord_mnl

See above.

Count DV

  • countOverZI 📘✏️   Launch Rstudio Binder
    Examines effect of overdispersion and/or a zero-inflated component on count model estimates. Features Poisson, negative binomial, zero-inflated Poisson, and zero-inflated negative binomial models.

Duration DV

  • mleDurat   Launch Rstudio Binder
    Focuses on the intuition behind maximum likelihood using a Weibull duration model. Students manually find the maximum of the model's likelihood function for a toy set of data. mleDurat displays a graph with the proposed best-fit line and fake data, and this line updates as students select different intercept + slope values.
  • whySurv    Launch Rstudio Binder

See shinyElements/whySurv

Notes

  • The apps may take a minute or two to launch. Hang tight.
    • The Binder page should load in a new window/tab once you click the link. If it doesn't, click the link again or manually copy/paste the URL into a new window/tab.
    • On the Binder page, as long as Found built image, launching... appears under the "Build Logs" header (click 'show' link at header's right to display the log), things are working fine.
    • = more complex apps. They'll take longer than the others to launch.
    • If there's no text in the log after 15 seconds or so, refresh the page. Rinse and repeat until the app loads.
    • If the app doesn't load within a minute or two after server running at https://... displays (it should auto-redirect), either type that URL manually into your browser or hit refresh. Rinse and repeat until the app loads.
  • Every click launches a separate Binder instance, even for the same app. This means multiple people can use the same app at once without any of the bottlenecking issues endemic to Shiny that stem from R being single-threaded.
  • To launch a different app, either come back to the GitHub repo and click the app's Binder link or hit 🔙 twice.1

Technical Notes

  • All the apps' Docker images have been prebuilt.
  • Binder suggests each Binder'd GitHub repo can support ~100 simultaneous users. My own rough tests suggest at least 50, under certain circumstances.
  • With how Binder's memory allocation works, the more any of the apps get used, the faster any of them will load.
  • If you fork any of the apps and make new commits in your forked repo, you'll have to go to the Binder homepage to generate a new link before you can run it on Binder. When you first access the generated link, Binder will build the Docker image. That usually takes anywhere from 20–40 minutes for the apps in their current state, depending.
  • Once a Binder is running, you can edit and run the code for any of the repo's apps in a RStudio session by changing the end of the URL from shiny/appName?token=... to rstudio/?token=.... (Others won't be able to see your edits.)
    > Note: Any changes you make to the code won't be stored. Save local copies of anything you need before closing the window/tab.

Other Apps

There are additional Shiny apps for linear regression models here.

Hat Tips

License

MIT


1: You can also technically load another app from the GitHub repo by modifying your current Binder session. The end of the current app's URL will be shiny/appName?token=.... Replace appName in the URL with the other app's name and hit Enter to load.

About

Various Shiny apps for regression models typically taught in a MLE/GLM course.

Resources

Stars

Watchers

Forks