Skip to content

R code for scoring some commonly used psychology measures

Notifications You must be signed in to change notification settings

yzpaul/r-psych-scoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

R code for scoring psychological testing measures

For most scales the default is alpha=F to return item scores. Pass alpha=T if you only want alpha values.

The term df is used to denote the input dataframe eg. for the rse the input value df could be represented by: data.frame(matrix(sample.int(15,100, TRUE), ncol=10)) although this example is unlikely to produce valid values for scoring

The number of columns is assumed to be the number of questions in the dataset. For example: in the IPIP 50, which has 50 questions, it is expected that your dataframe will have 50 columns where each column is a response to a question. Eg. column 1 is the response to the first question etc.

Scales

Functions to view data in APA format or calculate P and F from models

  • Output correlation in APA style

    • apaCorr2<-function(df,round_digits=2)
      • example: apaCorr2(data.frame(sample.int(20,10,replace=T),sample.int(20,10,replace=T)))
  • Shortcut function to calculate p-val from a linear model object

    • lmp <- function (modelobject)
      • example: lmp(lm(csv$bfat~csv$exer))
  • takes in linear model outputs: F(dfb,dfw)=fobt,p-val

    • prettyF<-function(x)
      • example: prettyF(lm(csv$bfat~csv$exer))
  • get semi-partial correlation

    • partial_df<-function(x,cont)
      • #example call: semi_partial_df(res,"gender") //where the dataframe has a column gender

About

R code for scoring some commonly used psychology measures

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages