GenerateConsensusData: GenerateConsensusData

View source: R/GenerateConsensusData.R

GenerateConsensusDataR Documentation

GenerateConsensusData

Description

This function simulates a simple survey, and is useful for testing the "Bayesian consensus" part of the AnthroTools package. It returns three objects- the most important being a hypothetical survey.

Usage

GenerateConsensusData(numPeople, numQuestions, numAns, lockCompetance = NA)

Arguments

numPeople

The number of people being surveyed

numQuestions

The number of questions in your survey

numAns

The number of possible answers on each question. It is assumed that all questions have the same number of answers.

Details

The survey assumes that each question has N possible answers and one correct answer. Each survey has a well-defined competence (picked at random) which does not vary from question to question. Competence determines the probability that they KNOW the answer. Each question will also have a randomly assigned "correct" answer. For each question, if the survey recipient knows the correct answer (with probability equal to their competence) they will pick that answer. Otherwise they will pick at random. This procedure is done for every "survey recipient" and every question, until a full batch of survey data is produced.

The purpose of this function is to allow false data to be easily created such that a given set of real data can be compared statistically to what would be expected assuming all the assumptions of the model (see paper in references) are true.

Value

This function will return a list containing three items.

Survey

This is a matrix, containing each survey recipients answers to every quetion. This set of survey results gives good input for ConsensusPipeline.

Answers

This gives a single row data frame containing the "Correct" answers to each survey question.

Competence

This gives a list of the alleged skill level of each survey participant in your simulated survey. Please not that for small numbers of questions, you can expect a significant difference between this "true" competence measure and an individuals number of correct answers.

Author(s)

Alastair Jamieson Lane. <aja107@math.ubc.ca>

Benjamin Grant Purzycki. <bgpurzycki@alumni.ubc.ca>

References

Oravecz, Z., Vandekerckhove, J., & Batchelder, W. H. (2014). Bayesian Cultural Consensus Theory. Field Methods, 1525822X13520280. http://doi.org/10.1177/1525822X13520280

Romney, A. K., Weller, S. C., & Batchelder, W. H. (1986). Culture as Consensus: A Theory of Culture and Informant Accuracy. American Anthropologist, 88(2), 313-338.

Examples

FakeData<- GenerateConsensusData(5,5,3)
FakeSurvey<-FakeData$Survey
Results<- ConsensusPipeline(FakeSurvey,3)

alastair-JL/AnthroTools documentation built on March 7, 2024, 11:59 p.m.