Get startedGet started for free

Standardized effect inference

In comparing my reaction times with those of my son Steven, we are interested in the regression model

$$ Time = \beta_0 + \beta_1 * Person $$

The parameter beta1 measures the change (from me to Steven) in mean reaction time and the parameter

delta = beta1 / S

represents the standardized change (in standard deviation units).

This exercise is part of the course

Beginning Bayes in R

View Course

Exercise instructions

  • Perform a regression fit of Time using Person as a covariate.
  • Simulate 1000 draws from the joint posterior distribution using the sim() function.
  • Extract the simulated values of (beta0, beta1) and S (functions coef() and sigma.hat()).
  • Compute the simulated values of the standardized change delta.
  • Find a 90% interval estimate for delta.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Perform a regression fit of Time with Person as a covariate: fit
fit <- lm(Time ~ Person, data = dd)

# Simulate 1000 values from the posterior distribution: sim_fit
sim_fit <- sim(fit, n.sims = 1000)

# Extract simulated draws of beta and S:  beta_sim, s_sim
beta_sim <- ___
s_sim <- ___

# Compute simulated values of the standardized change: s_delta


# Find 90% interval estimate for s_delta
Edit and Run Code