{"id":3552,"date":"2026-05-09T05:40:17","date_gmt":"2026-05-09T05:40:17","guid":{"rendered":"https:\/\/optimumsportsperformance.com\/blog\/?p=3552"},"modified":"2026-05-09T12:59:24","modified_gmt":"2026-05-09T12:59:24","slug":"bayesian-modeling-with-stan-part-3-handling-categorical-predictors","status":"publish","type":"post","link":"https:\/\/optimumsportsperformance.com\/blog\/bayesian-modeling-with-stan-part-3-handling-categorical-predictors\/","title":{"rendered":"Bayesian Modeling with STAN Part 3 &#8211; Handling Categorical Predictors"},"content":{"rendered":"<p>We&#8217;ve been discussing how to code STAN models and <span style=\"color: #0000ff;\"><strong><a style=\"color: #0000ff;\" href=\"https:\/\/optimumsportsperformance.com\/blog\/whats-the-plan-stan-bayesian-modeling-with-stan-part-1\/\">Part 1<\/a><\/strong><\/span> and <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/optimumsportsperformance.com\/blog\/bayesian-modeling-with-stan-part-2-multiple-linear-regression-model-checking\/\">Part 2<\/a><\/span><\/strong> served as a basic intro for simple linear regression, multiple linear regression, and model checking. Today, we cover how to code categorical variables into your models. STAN doesn&#8217;t handle categorical variables so, it&#8217;s on the user to properly index these variables as integers in the model. This can take a bit of practice and can get confusing. In this blog article I offer a few different approaches to accomplish the same task.<\/p>\n<p><strong>Click here to read the RMarkdown Blog Article &gt;&gt; <a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2026\/05\/STAN-Part-3-Handling-Categorical-Predictors.html\"><span style=\"color: #0000ff;\">STAN-Part-3&#8212;Handling-Categorical-Predictors<\/span><\/a><\/strong><\/p>\n<p><strong>Click here to access the code &gt;&gt; <span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/pw2\/STAN-Blog-Tutorials\/blob\/main\/STAN%20Part%203%20-%20Handling%20Categorical%20Predictors.Rmd\">STAN Part 3 &#8211; Handling Categorical Predictors<\/a><\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve been discussing how to code STAN models and Part 1 and Part 2 served as a basic intro for simple linear regression, multiple linear regression, and model checking. Today, we cover how to code categorical variables into your models. STAN doesn&#8217;t handle categorical variables so, it&#8217;s on the user to properly index these variables [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"class_list":["post-3552","post","type-post","status-publish","format-standard","hentry","category-bayesian-model-building"],"_links":{"self":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/3552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/comments?post=3552"}],"version-history":[{"count":3,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/3552\/revisions"}],"predecessor-version":[{"id":3556,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/3552\/revisions\/3556"}],"wp:attachment":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/media?parent=3552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/categories?post=3552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/tags?post=3552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}