Exploring an Autoregression for Insulin Dosage

My dog Sudo has diabetes. In humans, that is quite manageable. Constant monitoring of blood sugar levels and insulin dosage is required, but many tools exist to help with this and – importantly – are covered by medical insurance. The situation with dogs tends to be more challenging. Fewer tools are available and many people don’t have medical insurance for their dogs. According to our local vet, this unfortunately leads to many dogs being euthanized instead of cared for. Care for the dogs themselves is challenging. The process for establishing Sudo’s dose was as follows: for about two weeks, he wore a continuous glucose monitor (CGM) and we recorded his blood sugar levels. We then used that data to determine his insulin dosage. We settled on one specific dog food that he would get the same amount twice a day, every day so that his carb intake stays stable. We administer insulin twice a day with his food. The vet used that data to generate a dosing table. Most people apparently just use a fixed dose twice daily, because some dogs are not particularly fond of blood sugar sticks and CGM is expensive. Sudo has been doing well with the blood sugar pricks, so we have generally been able to use adjustment doses as recommended. ...

Sep 3, 2026 · 12 min · 2386 words · D. Michael Senter

New MI Post at SAS

My new post demonstrating how to do Bayesian analysis with MI is live.

Feb 18, 2025 · 1 min · 101 words · D. Michael Senter

Lotteries and Pascal's Mugging

Most have heard of Pascal’s wager, but have you heard of the thought experiment known as Pascal’s mugging? The mugging attempts to reframe the essence of the wager argument using only finite values, thereby getting around some standard objections to the wager argument. ...

Dec 18, 2024 · 5 min · 919 words · D. Michael Senter

From p-Values to Bayes Factors

Improve the interpretation of your frequentist analysis output’s strength of evidence by incorporating Bayes factor bounds using SAS.

Nov 13, 2024 · 6 min · 1148 words · D. Michael Senter

New MI Feature: Flux Statistics

The Viya 2024.04 release includes a brand new MI feature: new missing data statistics. An important choice when building an imputation model is the selection of variables to be included. One method to help in the variable selection process is the usage of summary statistics such as influx and outflux, as proposed by van Buuren. In his words: “Influx and outflux are summaries of the missing data pattern intended to aid in the construction of imputation models. Keeping everything else constant, variables with high influx and outflux are preferred. Realize that outflux indicates the potential (and not actual) contribution to impute other variables” ...

Apr 18, 2024 · 3 min · 448 words · D. Michael Senter

Calling R From SAS

The statistics literature is filled with example code and sample data in R. Sometimes I find myself wanting to work through some provided sample data and compare the output from R with SAS code. In this post, I’ll show how to connect R and SAS so that you can load and execute R code straight from within SAS. ...

Dec 22, 2023 · 2 min · 268 words · D. Michael Senter

Some Basic SQL Joins

A non-technical friend recently asked me for help with a merge problem. They had two separate data pulls of electronic medical records based on specific study parameters. The set of people in the database who fit the study parameters changed in between the data pulls, for example by having people age into our out of a study, or by having new diagnoses added to their records that cause them to either be newly included or excluded. Let’s call the older data set A and the newer data set B. The goal was to get all those entries from B that don’t also show up in A. The data sets were pulled by a staff data scientist at that company who, despite their title, said they couldn’t figure out how to remove those entries from B that were already in A. Barring any special circumstances, this is a fairly standard problem so let’s look at a couple of tools we could use to solve it. ...

Sep 5, 2023 · 4 min · 789 words · D. Michael Senter

Univariate Missing Data with PROC MI

In Chapter 3 of van Buuren’s Flexible Imputation of Missing Data a variety of methods for imputing univariate missing data are presented. This post will summarize these techniques and show how to implement them in SAS. ...

Aug 13, 2023 · 7 min · 1306 words · D. Michael Senter

Sampling Regression Lines

Last week we saw how to generate posterior samples using PROC MCMC for simple linear and logistic regression models. This week, I want to show how to sample regression lines from the data set returned by MCMC by plotting several sample regression linse on top of a scatter plot of the source data. ...

May 8, 2023 · 3 min · 549 words · D. Michael Senter

Simple Regression With PROC MCMC

In this post I’ll show how to fit simple linear and logistic regression models using the MCMC procedure in SAS. Note that the point of this post is to show how the mathematical model is translated into PROC MCMC syntax and not to discuss the method itself. I will include links to relevant sections in Johnson, Ott, and Dogucu (2022) if you’d like to read more about Bayesian modeling. ...

May 2, 2023 · 5 min · 1010 words · D. Michael Senter