Code Monkey home page Code Monkey logo

scaledic's Introduction

scaledic - A dictionary for scales

Have you ever thought it might be helpful to have additional information about a variable in a data frame, giving you a longer description, the scale it belongs to, whether it has reverse coding, valid values, value labels? And wouldn't it be nice to be able to check for typos, impute missing values, create scale scores, switch between long and short labels in a graph, etc. with just a few simple commands in R?

This is what scaledic aims to do. scaledic is an R package for extending data frames and tibbles with several scale-related attributes. It is designed to implement (psychometric) scale information for items in a data frame. This includes values, labels, subscales, weights, etc. A number of functions help to organise, extract, replace and impute missing values, find typos, build scale scores etc.

At the moment, scaledic already works and is up to the task, but is still in an experimental stage where I may change the basic syntax. The documentation is also poor. I am working on that.

Basically scaledic loads a dictionary file containing all relevant information and applies it to a data frame. Each variable corresponding to the ones described in the dictionary gets a new attribute dic which contains a list of all dictionary values for that variable.

The package contains a sample data frame ITRF with 4767 participants who filled in the integrated teacher report form questionnaire. dic_ITRF is a corresponding dictionary file for the ITRF (as the original data were collected in Germany, the dictionary file also has the German item labels).

scaledic's People

Contributors

jazznbass avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

jannisbosch

scaledic's Issues

labelled data from other packages

There are several packages for labelled data (e.g. haven, labelled).
scaledic could include some functions to translate scaledic labels to these other formats and vice versa.

Clean up functions and function names

There are a lot of functions which effects have been implemented into other functions.
Some functions are obsolete.
scaledic needs a definitive and systematic set of functions.

Check for data type of variables

The check_values function should report variables that are have the wrong data type (eg. an integer variable with datatype charcter )

Better names for dic parameters

Parameters of dictionary are all in capitals which should be changed.
Additionally parameter TYPE (for scale mode) should is not specific enough.
mode or level might be more appropriate

Variable subscale classes

Instead of just fixed subscale and subscale_2 dic attributes, new attributes should be set with in a dic file just by naming a column "subscale_" and a number after that.
So, if i set "subscale_3" and "subscale_4" these attributes will be set automatically in the dic attribute list and should be implemented in a all functions.

Implement new dic parameter `coding`

In cases where variables code responses/possible answers but not evaluative information (like points), recode could contain the level which represents a positive evaluation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.