ImportanceDementia and hepatic encephalopathy (HE) are challenging to distinguish clinically. Undiagnosed cirrhosis in a patient with dementia can lead to missed opportunities to treat HE.ObjectiveTo examine the prevalence and risk factors of undiagnosed cirrhosis and therefore possible HE in veterans with dementia.Design, Setting, and ParticipantsA retrospective cohort study was conducted between 2009 and 2019 using data from the Veterans Health Administration (VHA) and 2 separate validation cohorts from the Richmond Veterans Affairs Medical Center. Data analysis was conducted from May 20 to October 15, 2023. Participants included 177 422 US veterans with a diagnosis of dementia at 2 or more clinic visits, no prior diagnosis of cirrhosis, and with sufficient laboratory test results to calculate the Fibrosis-4 (FIB-4) score.ExposuresDemographic and clinical characteristics.Main Outcomes and MeasuresAn FIB-4 score (>2.67 suggestive of advanced fibrosis and >3.25 suggestive of cirrhosis), capped at age 65 years even for those above this cutoff who were included in the analysis.ResultsAmong 177 422 veterans (97.1% men; 80.7% White; mean (SD) age, 78.35 [10.97] years) 5.3% (n = 9373) had an FIB-4 score greater than 3.25 and 10.3% (n = 18 390) had an FIB-4 score greater than 2.67. In multivariable logistic regression models, FIB-4 greater than 3.25 was associated with older age (odds ratio [OR], 1.07; 95% CI, 1.06-1.09), male gender (OR, 1.43; 95% CI, 1.26-1.61), congestive heart failure (OR, 1.48; 95% CI, 1.43-1.54), viral hepatitis (OR, 1.79; 95% CI, 1.66-1.91), Alcohol Use Disorders Identification Test score (OR, 1.56; 95% CI, 1.44-1.68), and chronic kidney disease (OR, 1.11; 95% CI, 1.04-1.17), and inversely associated with White race (OR, 0.79; 95% CI, 0.73-0.85), diabetes (OR, 0.78; 95% CI, 0.73-0.84), hyperlipidemia (OR, 0.84; 95% CI, 0.79-0.89), stroke (OR, 0.85; 95% CI, 0.79-0.91), tobacco use disorder (OR, 0.78; 95% CI, 0.70-0.87), and rural residence (OR, 0.92; 95% CI, 0.87-0.97). Similar findings were associated with the FIB-4 greater than 2.67 threshold. These codes were associated with cirrhosis on local validation. A local validation cohort of patients with dementia showed a similar percentage of high FIB-4 scores (4.4%-11.2%).Conclusions and RelevanceThe findings of this cohort study suggest that clinicians encountering patients with dementia should be encouraged to screen for cirrhosis using the FIB-4 score to uncover reversible factors associated with cognitive impairment, such as HE, to enhance outcomes.