gravatar

jawitmer

Jeff Witmer

Recently Published

logistic coefficients
MedGPA data
logistic plot
Hair and Eye color dependence
Kruschke Chpt 24 example
Redundant predictors, third run
HighPeaks analysis using Ease and Difficulty (and Elevation, Ascent, Length)
HRC vs Trump kappa large PA51
kappa = 100 and PA at 51%
HRC vs Trump kappa large
kappa = 100 with PA at 48% (versus 51%)
HRC vs Trump kappa huge
Four states, 2016 polling, setting kappa = 255 and PA poll at 48% (versus 51%)
Olympic long jump raw data
Using Year
Olympic long jump scaled data
Using "Year - 1900"
MDove using lognormal likelihood
Mourning dove data in original scale, with a lognormal likelihood
MDove transformed
Mourning dove data in log scale.
Smokers FL vs CA .05 ROPE
Smokers FL vs CA
Alabama vs Oregon smoking
Marijuana age 18-25
NSDUH 2012 data marijuana use past month, age 18-25
Five coins 1/5, 1/5, 1/5, 1/5, 5/5
Old Figure 9.13 showing shrinkage. beta(2,2) on omega and gamma(1,.1) on kappaMinusTwo (so mean 10, sd 10). See Jags-Ydich-XnomSsubj-MbernBetaOmegaKappa-OldFigure9.13.R
Section 9.2.1 four beta graphs
omega 0.5 or 0.9 and kappa 5 or 75 #comment out line 7 of BetaPlot.R, then source('~/STAT 237/BetaPlot.R') par(mfrow=c(2,2)) BetaPlot(2.5,2.5) BetaPlot(3.7,1.3) BetaPlot(37.5,37.5) BetaPlot(66.7,8.3)
chickenpox posteriors
72/82 un vs 9/66 vac
BernBeta grid
Grid prior, Bernoulli data of 15/50
Jags-...MbernBeta-Example
Using JAGS and MCMC with beta(1,1) prior and data 15/50
BernBeta example
prior is beta(1,1) and data are 15/50
Guber plot SAT multivariate thinking
Created with R, the mosaic package, and the mPlot() command. This invoked the lattice package and the command below will reproduce this plot. xyplot( Mean.Total ~ Est.Mean.Salary, data=Raw.SAT.Data, groups=Level, main="", type=c("p","r"), auto.key=list(space="top", columns=3))
Publish Plot
kajdhfaldskhj
Publish Plot
my plot
four boxplots
four boxplots
Olympic Long Jump gold
Using a t likelihood for y
Normoxia vs hypoxia
soap and bacteria
Publish Plot
Free Throws guards vs centers
Toluene vs Control and NE conc in rats
run with Jags-Ymet-Xnom2grp-MrobustHet-Toluene2.R
CA cell phone law change
Soap 2-sample means
Love is Blind men
FT 2015 men vs women
Golf means by day of week
interaction ANOVA model with graphs
ANOVAtwowaySamuels11.7.3.R 2013 program
Lobsters means part 3
changed contrast from x1x2contrasts = list( list( list( c("CrushCut") , c("CutCut") ) , list( c("One") , c("Smooth") ) , compVal=0.0 , ROPE=c(-0.1,0.1) ) ) to x1x2contrasts = list( list( list( c("CrushCut") , c("CutCut") ) , list( c("Many") , c("Smooth") ) , compVal=0.0 , ROPE=c(-0.1,0.1) ) )
Lobster post means part 2
Lobsters with posterior means
Jags-Ycount-Xnom2fac-MpoissonExp-LobstersMean.R calling Jags-Ycount-Xnom2fac-MpoissonExpMean.R where line 322 has been edited to cenTend = "mean"
lobster Poisson page 2
Jags-Ycount-Xnom2fac-MpoissonExp-Lobsters.R
Lobsters with Poisson
Jags-Ycount-Xnom2fac-MpoissonExp-Lobsters.R page 1
SleuthIL graphs
Dopamine interaction
Jags-Ymet-XnomSplitPlot-MnormalHom-Dopamine.R graph 2
Dopamine Bayes split-plot
Jags-Ymet-XnomSplitPlot-MnormalHom-Dopamine.R
Alfalfa repeated measures as 2-factor (RBD) (B)ANOVA
Jags-Ymet-Xnom2fac-MnormalHom-Alfalfa.R
House Prices simple efffects plots
Jags-Ymet-Xnom2fac-MnormalHom-HousePriceBigMedvWC2.R
Iron Supp interaction part 2
Iron Supp with interaction part 1
Jags-Ymet-Xnom2fac-MnormalHom-IronSupp.R
HousePrices Post Pred check
HousePrice Big/Medium v West/Central
Jags-Ymet-Xnom2fac-MnormalHom-HousePriceBigMedvWC.R
HousePrice Small/Medium vs East/Central
Jags-Ymet-Xnom2fac-MnormalHom-HousePriceSmMedvEC.R
Iron supplements interaction 2013
ANOVAtwowaySamuels11.7.3.R
Leaf Area interaction effect (part 2)
Jags-Ymet-Xnom2fac-MnormalHom-LeafArea.R
Leaf Area interaction -- which is tiny -- model part1
Jags-Ymet-Xnom2fac-MnormalHom-LeafArea.R
Leaf Area additive model fit
Jags-Ymet-Xnom2fac-MnormalHom-LeafAreaAdditive.R after deleting or commenting out a1a2, b1b2, etc. interaction components
using new DBDA2E-utilities.R
Testosterone Post Pred check with t likelihood
Jags-Ymet-Xnom1fac-MrobustHet-Testosterone.R
LowSmoke vs HighNon use Hgt
Jags-Ymet-Xnom1met1-MnormalHom-WgtHabitsHgt.R
Wgt and Habits, control for Hgt Post Pred check
Jags-Ymet-Xnom1met1-MnormalHom-WgtHabitsHgt.R
LowSmoke vs HighNon mean ignore Hgt
Jags-Ymet-Xnom1fac-MnormalHom-WgtHabits.R
LowSmoker vs HighNonsmoker Wgt, covariate Hgt
Jags-Ymet-Xnom1met1-MnormalHom-WgtHabits.R
{Actor, MD} vs {Minister, Prof}
Jags-Ymet-Xnom1fac-MnormalHom-Testosterone3.R
Actor vs Prof
Jags-Ymet-Xnom1fac-MnormalHom-Testosterone.R
Soap Normal likelihood, aSigma as a Gamma
Jags-Ymet-Xnom1fac-MnormalHom-SoapNormal.R
Soap post pred check
Soap traditional (fixed aSigma at 40) fit
Jags-Ymet-Xnom1fac-MnormalHom-SoapTraditional.R
Testoterone four deflections
Actors versus Profs
testosterone 2013 graphs
Fruitfly ANOVA example
Soap ANOVA with par(ps=12)
Added to line 231 of Jags-Ymet-Xnom1fac-MnormalHom.R
Soap ANOVA graphs default
Without using par(ps=12) in line 231
Perch interaction model
Jags-Ymet-XmetMulti-Mrobust-PerchInteract.R
MLB2007 last 6 betas
MLB2007 second 6 betas
MLB2007 first 6 betas
Kids198 interact
Jags-Ymet-XmetMulti-Mrobust-KidsInteract.R
High Peaks Difficulty and Ease
Ease = 7 - Difficulty
High Peaks posteriors
High Peaks mult reg
Jags-Ymet-XmetMulti-Mrobust-HighPeaks.R
Steers reg dgamma(13,12)
Jags-Ymet-XmetSsubj-MrobustHierC.R using dgamma(13,12) priors on zbeta0sigma and zbeta1sigma
Steers growth over time
via 2013 program
Steer 17.3 reg
Steer wt reg global slope and intercept
Jags-Ymet-XmetSsubj-MrobustHier-SteerWeight.R calling Jags-Ymet-XmetSsubj-MrobustHierA.R
NM Diffs with +1
adding 1 rather than 0.01
NM Diff + 0.10
instead of adding 0.01, now adding 0.10
Weibull means histogram
rjags output mean NMDiff.R
Weibull NMDiffs
Jags-Ymet-Xnom1grp-Mweibull-NMDiffs.R using vague priors on nu and lambda; adding 0.01
NM randomization test
H0: mu=1.32 with Lock5 logic and my R script
CO2 quadratic fit
Jags-Ymet-XmetMulti-Mrobust-CO2quadFit.R
Textbook Prices regression with vague prior on the slope
Jags-Ymet-Xmet-Mrobust-TextbookPrices.R
Textbook Prices with infomative prior
Jags-Ymet-Xmet-Mrobust-TextPricesInformed.R calling Jags-Ymet-Xmet-Mrobust-TextInf.R with line 48 as zbeta1 ~ dnorm( 1.117 , 35.4 )
Olympic Long Jump post pred check with scaled data
Jags-Ymet-Xmet-Mrobust-OlyLongJump.R with Year - 1900
Olympic Long Jump regression scaled data
Jags-Ymet-Xmet-Mrobust-OlyLongJump.R with Year - 1900
Olympic Long Jump post pred raw scale
Jags-Ymet-Xmet-Mrobust-OlyLongJump.R without subtracting 1900 from each year.
Olympic Long Jump regression raw scale
Jags-Ymet-Xmet-Mrobust-OlyLongJump.R without subtracting 1900 from each year.
MDove lognormal likelihood
Jags-Ymet-Xnom1grp-Mlognormal-MDove.R
MDove with lognormal density
Jags-Ymet-Xnom1grp-Mrobust-MDoveLogNormal.R after some editing of Jags-Ymet-Xnom1grp-MlogNormal.R
BEST MDove after taking logs
BESTMDoveLog.R output
Monarch wings normal/normal
Jags-Ymet-Xnom1grp-Mnormal-Monarch.R
BEST 2 groups Soap analysis
from running BEST 2 groups Soap.R
Soap 2-group comparison
Soap vs control, y=#bacterial colonies.
BEST Monarch wings
Monarch wings robust
Using a t density for the likelihood, rather than a normal.
SAT-M n=2 700, 650
Jags-Ymet-Xnom-SATM n=2.R calling Jags-Ymet-Xnom1grp-MnormalJAWxBreaks.R (where xBreaks = 10) with mu ~ dnorm( 500 , 1/100^2 ) sigma ~ dunif( 34.5, 35.5 ) After changing plotPost... [3] for mean (vs mode) in D...utilities.R
SAT-M n=1 700
Jags-Ymet-Xnom-SATM n=1.R calling Jags-Ymet-Xnom1grp-MnormalJAWxBreaks.R (where xBreaks = 10) with mu ~ dnorm( 500 , 1/100^2 ) sigma ~ dunif( 34.5, 35.5 ) After changing plotPost... [3] for mean (vs mode) in D...utilities.R
SAT-M n=2 700, 650
Jags-Ymet-Xnom-SATM n=2.R calling Jags-Ymet-Xnom1grp-MnormalJAW.R with mu ~ dnorm( 500 , 1/100^2 ) sigma ~ dunif( 34.5, 35.5 )
UConn women vs Kentucky men Free Throws
Jags-FreeThrowShooting2015menVsWomen.R
K-12 perfect attendance for one month
z=2740 out of N=8302 K-12 kids with perfect attendance. Was 34% in 1990s. Beta(1,1) prior on theta. ROPE is 34% +/- 2%. (Via DeVeaux et al. page 496.)
FT centers vs point guards
2 centers and 2 point guards 2015 prior to Sweet 16 games
FT 2015 women 35K
thinSteps=5, savedSteps=35000
FT 2015 women 11000
thinSteps=20 savedSteps=11000
Kruschke baseball by position omegas
Jags-Ybinom-XnomSsubjCcat-MbinomBetaOmegaKappa-Example.R run with default priors
Kruschke baseball by position posterior kappas
Jags-Ybinom-XnomSsubjCcat-MbinomBetaOmegaKappa-Example.R run with default priors
Morris baseball with beta(4,11) and gamma(1,.1)
beta(4,11) on omega and kappa as gamma(1,.1) so mean 10, sd 10.
Morris baseball shrinkage
Bayesian shrinking using a prior on omega of beta(4,11) to match MLB average hitting. Prior on kappa was gamma(1,0.1) so mean 10, sd 10.
T Touch faked analysis
Using Jags-Ybinom-XnomSsubjCcat-MbinomBetaOmegaKappa-ExampleTT.R so that binomial inputs are accepted (so I put a couple of subjects in "cat2" versus "cat1"
Five coins shrinkage 1/5, 1/5, 1/5, 1/5, 5/5
Old Figure 9.13 showing shrinkage. beta(2,2) on omega and gamma(1,.1) on kappaMinusTwo (so mean 10, sd 10). See Jags-Ydich-XnomSsubj-MbernBetaOmegaKappa-OldFigure9.13.R
Figure 9.5 posteriors on theta1 and theta2
I edited the workhorse program Jags-Ydich-XnomSsubj-MbernBetaOmegaKappaFig9.5.R at lines 39 and 41 to give omega a beta(2,2) prior and make kappa a constant (effectively).
Figure 9.5 posterior on omega (and kappa a constant)
I edited the workhorse program Jags-Ydich-XnomSsubj-MbernBetaOmegaKappaFig9.5.R at lines 39 and 41 to make kappa effectively a constant and to have a beta(2,2) prior on omega.
Figure 9.5 priors for theta1 and theta2
I edited the workhorse program Jags-Ydich-XnomSsubj-MbernBetaOmegaKappaFig9.5.R at lines 39 and 41 plus I commented out reading data at line 24.
Figure 9.5 prior on Kappa as a constant and on omega be(2,2)
I edited the workhorse program Jags-Ydich-XnomSsubj-MbernBetaOmegaKappaFig9.5.R at lines 39 and 41 plus I commented out reading data at line 24.
Guber with 2010 data, red line adjusts for percentSAT (plotted at the mean)
plot(Total~salary, data=Guber, pch=16, ylab="State average SAT score", xlab="Average teacher salary") mod1=lm(Total~salary, data=Guber) summary(mod1) abline(mod1) #Now control for percent taking SAT mod2=lm(Total~salary + percentSAT, data=Guber) summary(mod2) library(TeachingDemos) mean(Guber$percentSAT) #38.52 Predict.Plot(mod2, pred.var = "salary", percentSAT = 38.5, plot.args = list(lty=2, lwd=2, col='red'), type = "response", add=TRUE)
Gruber updated to 2009-10 data
#Guber 1995-style analysis of SAT scores and teacher salaries by state, but with 2010 data #I have SAT data for 2009-10 but % taking is 2010-11, salaries are 2009-10 Guber <- read.csv("~/STAT 213/213 Class data/GuberSATupdated2010.csv") str(Guber) plot(Total~salary, data=Guber, pch=16, ylab="State average SAT score", xlab="Average teacher salary") mod1=lm(Total~salary, data=Guber) summary(mod1) abline(mod1)
Gruber 2010 stratified by percentSAT
Guber$level = cut(Guber$percentSAT, breaks = c(0,5,50,100), labels=c("low","middle","high")) table(Guber$level) #head(Guber) low=Guber$level=="low"; mid=Guber$level=="middle"; high=Guber$level=="high" plot(Total~salary, data=Guber, type="n", ylab="State average SAT score", xlab="Average teacher salary") points(Guber$Total[low]~Guber$salary[low],pch=16, col="blue") points(Guber$Total[mid]~Guber$salary[mid],pch=16,col="red") points(Guber$Total[high]~Guber$salary[high],pch=16,col="green") library(dplyr) mod3low=lm(Total~salary, data=filter(Guber, level=="low")) #summary(mod3low) abline(mod3low,col="blue",lwd="2") mod3mid=lm(Total~salary, data=filter(Guber, level=="middle")) abline(mod3mid,col="red",lwd="2") mod3high=lm(Total~salary, data=filter(Guber, level=="high")) abline(mod3high,col="green",lwd="2")
Thorax BayesianFirstAid male vs female
from plot(bayes.t.test(data~group))
Thorax male vs female Monarch butterflies
Samuels page 214 data fit using default priors
sampling from priors (of Be(1,1))
after commenting out line 23 of Jags-Ydich-XnomSsubj-MbernBetaJAW
Section 9.2.1 four beta graphs
omega 0.5 or 0.9 and kappa 5 or 75
Chickenpox
Samuels page 604 chickenpox data: 72/82 cases among unvaccinated vs only 9/66 among children vaccinated.
Love is Blind Be(1,2) priors -- for guessing
Love is Blind but with prior means of 1/3 = guessing percentage.
Love is Blind
using Be(1,1) priors for the Love is Blind data; theta1 = female
Free Throws 2015 NCAA four women's teams
Comparing four women's teams, within the men vs women hierarchical modeling fit.
sampling from the prior Be(1,1)
Put a # in front of line 23 in the lower-level program, Jags-Ydich-XnomSsubj-MbernBetaJAW in which the dataList and model are specified.
migraines Be(1,1) prior and Be(1,5) prior for sham
Uniform prior on theta(surgery) but skeptical, Be(1,5) prior on theta(sham).
migraines Be(1,1) priors alphabetical
Samuels Example 10.1.1 Migraines 41/49 vs 15/26 using beta(1,1) priors in Jags-Ydich-XnomSsubj-MbernBeta-migraine.R. Theta1 for "asurgery", theta2 for sham.
migraine posteriors via Jags-Ydich...-migraine.R with Be(1,1) priors
Samuels Example 10.1.1 Migraines 41/49 vs 15/26 using beta(1,1) priors in Jags-Ydich-XnomSsubj-MbernBeta-migraine.R.
migraine posteriors via Jags-Ydich...-migraine.R
Samuels Example 10.1.1 Migraines 41/49 vs 15/26 using default beta(2,2) priors in Jags-Ydich-XnomSsubj-MbernBeta-migraine.R.