View source: R/calculate_proportion.R
calculate_proportion | R Documentation |
This function allows you to create normal populations for data that would include repeated measures items. Additionally, the data can be rounded and/or truncated to ensure it matches a target scale - for example, a 1-7 type rating scale.
calculate_proportion(samples, cutoff, grouping_items = NULL, score)
samples |
The bootstrapped samples from your population |
cutoff |
The cutoff score for an item to be well measured from the standard errors of your items |
grouping_items |
The names of columns to group your data by for the cutoff calculation, usually this column is the item column |
score |
The column of the score you wish to calculate for your cutoff score SE |
Summary of the proportion of items below the standard error cutoff score.
# step 1 create data like what I think I'll get or use your own
pops <- simulate_population(mu = 4, mu_sigma = .2, sigma = 2,
sigma_sigma = .2, number_items = 30, number_scores = 20,
smallest_sigma = .02, min_score = 1, max_score = 7, digits = 0)
# step 2 calculate our cut off score
cutoff <- calculate_cutoff(population = pops,
grouping_items = "item",
score = "score",
minimum = 1,
maximum = 7)
cutoff$se_items
cutoff$sd_items
cutoff$cutoff
cutoff$prop_var
# step 3 simulate samples
samples <- simulate_samples(start = 20, stop = 100,
increase = 5, population = pops,
replace = TRUE, grouping_items = "item")
# step 4 and 5
proportion_summary <- calculate_proportion(samples = samples,
cutoff = cutoff$cutoff,
grouping_items = "item",
score = "score")
proportion_summary
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.