#### For the case you do not need additional matching criterion
item_info <- triplet_block_info
test_bp <- construct_blueprint(N_blocks = 2, block_size = 3,
traits = c("honestyhumility", "emotionality", "extraversion",
"agreeableness", "conscientiousness", "openness"),
signs = c(-1, 1, 1,
-1, -1, -1))
### Some arguments can be omitted if you don't have extra matching criteria.
picked_scale <- build_scale_with_blueprint(item_df = item_info,
blueprint = test_bp,
### These parameters are column names in test_bp
bp_block_name = "block",
bp_item_nums_name = "item_num",
bp_trait_name = "traits",
bp_sign_name = "signs",
### These parameters are column names in item_info
df_item_nums_name = "ID",
df_trait_name = "Factor",
df_sign_name = "Keying")
#### Or you may want to match social desirability ratings, for example
test_bp2 <- test_bp
test_bp2$SD_matching <- rep(0.5, 6)
#### Suppose that the items also have their own ratings
item_info2 <- item_info
item_info2$SD_rating <- rnorm(15, 3.5, 1)
range_m <- function(x) {
return(max(x) - min(x))
}
picked_scale2 <- build_scale_with_blueprint(item_df = item_info2,
blueprint = test_bp2,
### These parameters are column names in test_bp2
bp_block_name = "block",
bp_item_nums_name = "item_num",
bp_trait_name = "traits",
bp_sign_name = "signs",
### These parameters are column names in item_info2
df_item_nums_name = "ID",
df_trait_name = "Factor",
df_sign_name = "Keying",
### These parameters will be used
### when you have extra matching criteria
df_matching_criterion_name = "SD_rating",
bp_matching_criterion_name = "SD_matching",
## Which function is used to calculate matching?
df_matching_function = "range_m",
df_matching_adjust_factor = 1.25,
max_attempts_in_comb = 100,
max_attempts_in_adjust = 20)
Run the code above in your browser using DataLab