PCS_Calculation {T2DFitTailor} | R Documentation |
Calculate PCS (Physical Component Summary) Scores
Description
This function calculates the Physical Component Summary (PCS) scores based on a set of specific questionnaire items related to physical and mental health domains. It requires a dataframe containing the required columns with valid answer ranges, and outputs a dataframe with PCS scores.
Usage
PCS_Calculation(df)
Arguments
df |
A dataframe containing the questionnaire items with answers. The dataframe should have specific columns:
|
Value
A dataframe containing the calculated PCS scores.
References
Tucker G, Adams R, Wilson D. New Australian population scoring coefficients for the old version of the SF-36 and SF-12 health status questionnaires. Qual Life Res. 2010 Sep;19(7):1069-76. doi: 10.1007/s11136-010-9658-9. Epub 2010 May 4. Erratum in: Qual Life Res. 2010 Sep;19(7):1077. PMID: 20440565.
Examples
set.seed(123)
sample_names <- c("xiaoming", "xiaohong", "xiaohua")
df <- data.frame(
row.names = sample_names,
EVGFP_rating = sample(1:5, 3, replace = TRUE),
Moderate_activities = sample(1:3, 3, replace = TRUE),
Climb_several_flights = sample(1:3, 3, replace = TRUE),
Accomplished_less_physically = sample(1:2, 3, replace = TRUE),
Limited_in_kind_physically = sample(1:2, 3, replace = TRUE),
Accomplished_less_mentally = sample(1:2, 3, replace = TRUE),
Not_careful_mentally = sample(1:2, 3, replace = TRUE),
Pain_interfere = sample(1:5, 3, replace = TRUE),
Calm = sample(1:6, 3, replace = TRUE),
Energy = sample(1:6, 3, replace = TRUE),
Felt_down = sample(1:6, 3, replace = TRUE),
Social_time = sample(1:5, 3, replace = TRUE)
)
PCS_output <- PCS_Calculation(df)
PCS_output