Mirza's Notes on Mirza Khan's Notes
https://notes.mirzakhan.com/
Recent content in Mirza's Notes on Mirza Khan's NotesHugo -- gohugo.ioen-usMon, 26 Jun 2017 18:27:58 +0100R thing of the day: scrape file links and download each file
https://notes.mirzakhan.com/2022-03-09-r-thing-of-the-day-scrape-file-links-and-download-each-file/
Wed, 09 Mar 2022 00:00:00 +0000https://notes.mirzakhan.com/2022-03-09-r-thing-of-the-day-scrape-file-links-and-download-each-file/I created a data package in R to accompany what I believe is an absolutely wonderful biostatistics text book, Regression Methods in Biostatistics: Linear, Logistic, Survival, and Repeated Measures Models.1 The package is available over here on GitHub. When I first started going over the material from the book and converting their analyses from Stata to R, I was unable to access the datasets. I made do by finding the datasets on someone’s public GitHub repo.R thing of the day: Speed up base R using the collapse package
https://notes.mirzakhan.com/2022-03-09-r-thing-of-the-day-speed-up-base-r-using-the-collapse-package/
Wed, 09 Mar 2022 00:00:00 +0000https://notes.mirzakhan.com/2022-03-09-r-thing-of-the-day-speed-up-base-r-using-the-collapse-package/#tldr: just add these 2 lines options(collapse_mask = "all") library(dplyr) library(collapse) Begin your script by setting the collapse_mask option. See help('collapse-options') for more options, e.g. "manip". Needs to come after library(dplyr) for collapse_mask to work I’m a huge fan of the tidyverse, but I also adore data.table (especially when I need/want an extra speedup ποΈ). My go-to is fread to load CSV files, and I often consider trying out vroom more often as it seems to be competitive.TIL: Make a plot with "broken"/"discontinuous" axes
https://notes.mirzakhan.com/2022-03-03-til-make-a-plot-with-broken-discontinuous-axes/
Thu, 03 Mar 2022 00:00:00 +0000https://notes.mirzakhan.com/2022-03-03-til-make-a-plot-with-broken-discontinuous-axes/There are times when you may wish to add a “break” on the plot axis to help display the graphical content without sacrificing content information. Typically, a “break” (when present) is used on the y-axis. The times I want to make a plot like this, I always have a difficult time finding the desired package and approach to make plots like these. This is likely because “breaks” in ggplot parlance can mean something different from what I’m intending.Simple Linear Regression (featuring Bayes!) in R, Python, and Julia
https://notes.mirzakhan.com/2022-01-12-simple-linear-regression-featuring-bayes-in-r-python-and-julia/
Wed, 12 Jan 2022 00:00:00 +0000https://notes.mirzakhan.com/2022-01-12-simple-linear-regression-featuring-bayes-in-r-python-and-julia/$$ \mathbf{y} = \alpha + \mathbf{X \beta} + \varepsilon $$
where:
\(\mathbf{y}\) is the outcome/dependent variable \(\alpha\) is the intercept \(\mathbf{X}\) is the feature/covariate matrix \(\mathbf{\beta}\) is the coefficient vector \(\varepsilon\) is the error term Linear regression models the mean and variance of a variable. In the case of simple linear regression, the main purpose of this model is to determine how the average value of the continuous outcome \(y\) varies with the value of a single predictor \(x\).Causal Inference: Sodium intake and Blood Pressure Simulation and ATE Estimation
https://notes.mirzakhan.com/2022-01-06-causal-inference-sodium-intake-and-blood-pressure-simulation-and-ate-estimation/
Thu, 06 Jan 2022 00:00:00 +0000https://notes.mirzakhan.com/2022-01-06-causal-inference-sodium-intake-and-blood-pressure-simulation-and-ate-estimation/A recent XKCD comic took me back to my Causal Inference course and gives off Goldilocks vibes.
I recently was going through Brady Neal’s excellent Introduction to Causal Inference Course. He goes through an excellent simulated dataset to demonstrate how different covariate adjustment approaches can influence your coefficient estimates. This simulation comes from Luque-Fernandez et al.’s 2018 paper, Educational Note: Paradoxical collider effect in the analysis of non-communicable disease epidemiological data: a reproducible illustration and web application with an accompanying shiny app.Reading CSVs in Python: pandas, polars, and datatable
https://notes.mirzakhan.com/2021-12-18-reading-csvs-in-python-pandas-polars-and-datatable/
Sat, 18 Dec 2021 00:00:00 +0000https://notes.mirzakhan.com/2021-12-18-reading-csvs-in-python-pandas-polars-and-datatable/I typically use pandas to read CSV files in Python. Anecdotally, most data scientists operating in the Python ecosystem do the same. When using R, I tend to bounce between dplyr or data.table. I always think about giving dtplyr a try to ge the “best of both worlds,” but I haven’t gotten around to it. I just came across the polars Python package today and thought I’d to a quick (and too simple) benchmark comparing pandas, polars (eager and lazy execution), and datatable.Open Tabs (01-31-21): Propensity Scores and xaringan
https://notes.mirzakhan.com/2021-02-05-open-tabs-week-of-01-31-21-propensity-scores-xaringan-goodies/
Fri, 05 Feb 2021 00:00:00 +0000https://notes.mirzakhan.com/2021-02-05-open-tabs-week-of-01-31-21-propensity-scores-xaringan-goodies/Memes Who made this pic.twitter.com/212bG8vZf0
— Maarten van Smeden (@MaartenvSmeden) February 4, 2021 When you ask an economist to model something. pic.twitter.com/O3a6CJXeoG
— Edmund Helmer (@theotheredmund) January 13, 2021 π This is me whenever I need to share my screen…
Canβt wait to facilitate this one-of-a-kind experience for my students next quarter. pic.twitter.com/u1FArfzjVs
— Alexia Fawcett (@alexiazandra) February 4, 2021 Propensity Scores I attended Todd Wagner’s talk on Propensity Scores as part of the VA HERC lecture series.Measuring Jugular Venous Pressure
https://notes.mirzakhan.com/2021-02-01-measuring-jugular-venous-pressure/
Mon, 01 Feb 2021 00:00:00 +0000https://notes.mirzakhan.com/2021-02-01-measuring-jugular-venous-pressure/We use our non-invasive jugular venous pressure (JVP) assessment to measure right atrial pressure (RAP). Generally, a normal RAP is < 6 mmHg (via cath) or < 8 cm H2O (via exam).
Methods for assessment: Seated at 90Λ (Source) JVP elevated if can be seen above the clavicle Β± abdominojugular reflux testing Clavicles are β 12-16 cm above the mid-RA Seated at 30-45Λ JVP elevated if > 8 cm Add or remove pillows PRN to relax SCM Add 5 cm from the sternal angle (angle of Louis) Turns out that the actual distance from the sternal angle to the level of the mid-right atrium varies considerably b/w pts and based on pt position.Cupper Typography
https://notes.mirzakhan.com/cupper-typography/
Thu, 14 Feb 2019 15:36:09 -0600https://notes.mirzakhan.com/cupper-typography/Headings # Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6 Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 Text *This text will be italic* _This will also be italic_ **This text will be bold** __This will also be bold__ _You **can** combine them_ This text will be italic
This will also be italic
This text will be boldHugo+Cupper Shortcodes
https://notes.mirzakhan.com/cupper-shortcodes/
Tue, 12 Feb 2019 23:39:06 -0600https://notes.mirzakhan.com/cupper-shortcodes/Check out rmarkdown::convert_ipynb() to convert Jupyter notebooks to (you guessed it) Rmarkdown. Alternatively, this gist by Alex Hayes' provides an alternative solution. Handy HTML codes <code>dplyr</code> <a href="https://google.com">Google<a> Hugo Shortcodes Below are some one’s I commonly use, so I’ve placed them here for quick reference. A more extensive list can be found here
figure {{< figure src="https://www.calvinandhobbes.com/wp-content/uploads/2016/09/character-calvin.jpg" title="Calvin of Calvin and Hobbes" >}} Calvin of Calvin and Hobbes gist For example, I wish to embed the following gist: https://gist.About
https://notes.mirzakhan.com/about/
Wed, 09 Apr 2014 00:00:00 +0000https://notes.mirzakhan.com/about/π€