H Luei
H Luei

Reputation: 1

Linear regression of a categorical variable, calculating the β (95% CI) and P for trends

I recently read an article by JAMA, titled "Trends in Sedentary Behavior Among the US Population, 2001-2016". I want to learn their method.

The article says this:

"Crude linear trends in sedentary behaviors were evaluated using linear regression models across survey cycles and to estimate regression coefficients (β) and 95% CIs for every 2-year change. P for trends were estimated using the survey cycle as a continuous variable."

Please help me to fit a linear regression model and calculate this results. I want to calculate the β (95% CI) and P for trend in the following picture.

enter image description here The data:

data <- data.frame(
  Year_group = c("2001-2002", "2003-2004", "2005-2006", "2007-2008", "2009-2010","2011-2012","2013-2014","2015-2016"),
  Incidence = c(65.5,72.6,61.0,63.2,61.8,63.6,57.6,62.2),
  CI_Lower = c(59.1, 68.1, 56.3, 57.8, 54.5,59.2,53.7,57.1),
  CI_Upper = c(72.0, 77.2, 65.7, 68.7, 69.1,68.0,61.4,67.2))

Upvotes: 0

Views: 67

Answers (0)

Related Questions