MakeDiscountedAgreementMatrix: MakeDiscountedAgreementMatrix

View source: R/MakeDiscountedAgreementMatrix.R

MakeDiscountedAgreementMatrixR Documentation

MakeDiscountedAgreementMatrix

Description

Given a bunch of answers to a survey, this function makes a matrix representing what fraction of the time each person agreed with each other person, and then discounts this value, based on how often you would expect this to happen by chance.

Usage

MakeDiscountedAgreementMatrix(SurveyResults, numAns)

Arguments

SurveyResults

A matrix containing the answers to a bunch of survey questions. Each row represents a particular individual and each column represents a particular question.

numAns

This is a number, and represents the total number of answers available for each question. Currently it is assumed that all questions have the same number of answers. If I get enough requests, I'll look into the programming and mathematics required to vectorise this so that different questions can have different numbers of answers.

Value

A matrix, where each entry represents the probability that two individuals will both know the answer to some randomly selected question.

Author(s)

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

Benjamin Grant Purzycki. <bgpurzycki@cas.au.dk>#' @export

Examples

FakeData<- GenerateConsensusData(8,8,4)
Survey <- FakeData$Survey
M <- MakeDiscountedAgreementMatrix(Survey, 4)

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