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
Run the code above in your browser using DataLab