{"id":26094071,"url":"https://github.com/statismike/stenr","last_synced_at":"2025-07-20T02:31:46.163Z","repository":{"id":38819893,"uuid":"423616951","full_name":"StatisMike/stenR","owner":"StatisMike","description":"R6-based Standardization of Raw Discrete Scores ","archived":false,"fork":false,"pushed_at":"2022-08-31T17:58:17.000Z","size":5682,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-17T17:21:21.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://statismike.github.io/stenR/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StatisMike.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-01T21:08:53.000Z","updated_at":"2022-04-26T17:13:07.000Z","dependencies_parsed_at":"2022-08-16T20:30:42.260Z","dependency_job_id":null,"html_url":"https://github.com/StatisMike/stenR","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/StatisMike/stenR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2FstenR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2FstenR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2FstenR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2FstenR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StatisMike","download_url":"https://codeload.github.com/StatisMike/stenR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2FstenR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266058469,"owners_count":23870155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-09T12:49:43.783Z","updated_at":"2025-07-20T02:31:46.129Z","avatar_url":"https://github.com/StatisMike.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  fig.width = 6,\n  fig.height = 4\n)\nSys.setenv(LANGUAGE='en')\nlibrary(stenR)\n```\n\n# stenR \u003cimg src='man/figures/logo.png' align=\"right\" width=\"200\" style=\"float:right; width:200px !important;\"/\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![codecov](https://codecov.io/gh/StatisMike/stenR/branch/master/graph/badge.svg?token=H62VR1J454)](https://app.codecov.io/gh/StatisMike/stenR)\n\u003c!-- badges: end --\u003e\n\n`stenR` is a package tailored mainly for users and creators of psychological questionnaires,\nthough other social science researchers and survey authors can benefit greatly\nfrom it.\n\nIt provides tools to help with processes necessary for conducting such studies:\n\n1. processing data from raw item scores to raw factor/scale scores\n1. standardization of the raw scores into standard scale of your choosing, either\nby:\n   - normalization of the raw scores using frequency table (if no norms have\n   been developed before). Usually for authors of questionnaires or their\n   adaptations.\n   - importing scoring table developed by questionnaire authors - for researchers\n   only using the measure\n\nFurthermore, tools for developing or using norms on grouped basis are also\nprovided (up to two intertwined grouping conditions are supported).\n\nMost in-depth information is provided within vignette **Tour from data to results**\n(for basic and verbose explanation) and less verbose but more complete in\n**stenR usage** vignette.\n\n## Installation\n\nYou can install the current version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"StatisMike/stenR\")\n```\n\n## Usage\n\n### Data processing\n\nProcess data from item raw scores to factor/scales scores\n\n```{r data_process}\n# Exemplary data provided within package\nstr(SLCS)\n\n# create scale specifications\nSL_spec \u003c- ScaleSpec(\n  name = \"Self-Liking\",\n  item_names = c(\"SLCS_1\", \"SLCS_3\", \"SLCS_5\", \"SLCS_6\", \"SLCS_7\", \n                 \"SLCS_9\", \"SLCS_11\", \"SLCS_15\"),\n  min = 1,\n  max = 5,\n  reverse = c(\"SLCS_1\", \"SLCS_6\", \"SLCS_7\", \"SLCS_15\")\n)\n\nSC_spec \u003c- ScaleSpec(\n  name = \"Self-Competence\",\n  item_names = c(\"SLCS_2\", \"SLCS_4\", \"SLCS_8\", \"SLCS_10\", \"SLCS_12\",\n                 \"SLCS_13\", \"SLCS_14\", \"SLCS_16\"),\n  min = 1,\n  max = 5,\n  reverse = c(\"SLCS_8\", \"SLCS_10\", \"SLCS_13\")\n)\n\nGS_spec \u003c- CombScaleSpec(\n  name = \"General Score\",\n  SL_spec,\n  SC_spec\n)\n\n# summarize data into factors/scales\nsummed_data \u003c- sum_items_to_scale(\n  data = SLCS,\n  SL_spec,\n  SC_spec,\n  GS_spec,\n  retain = c(\"user_id\", \"sex\")\n)\n\nstr(summed_data)\n```\n\n### Create *FrequencyTable*, *ScoreTable* for normalization\n\nGenerate norms from raw data to normalize and standardize results\n\n```{r ungrouped_FT}\nGS_ft \u003c- FrequencyTable(summed_data$`General Score`)\nplot(GS_ft)\n\nGS_st \u003c- ScoreTable(GS_ft, scale = STEN)\nplot(GS_st)\n\nnormalized_GS \u003c- normalize_score(\n  summed_data$`General Score`,\n  table = GS_st,\n  what = \"sten\"\n)\n\nnormalized_data \u003c- normalize_scores_df(\n  data = summed_data,\n  vars = \"General Score\",\n  GS_st,\n  what = \"sten\",\n  retain = c(\"user_id\", \"sex\")\n)\n\nstr(normalized_GS)\nstr(normalized_data)\n```\n\n### Create *GroupedFrequencyTable* and *GroupedScoreTable*\n\nGenerate norms for different groups on basis of up to two *GroupConditions*\nobjects\n\n```{r grouped_tables}\nsex_grouping \u003c- GroupConditions(\n  conditions_category = \"Sex\",\n  \"M\" ~ sex == \"M\",\n  \"F\" ~ sex == \"F\",\n  \"O\" ~ sex == \"O\"\n)\n\nGS_gft \u003c- GroupedFrequencyTable(\n  data = summed_data,\n  conditions = sex_grouping,\n  var = \"General Score\",\n  .all = FALSE\n)\nplot(GS_gft)\n\nGS_gst \u003c- GroupedScoreTable(GS_gft, scale = STEN)\nplot(GS_gst)\n\ngrouping_normalized \u003c- normalize_scores_grouped(\n  data = summed_data,\n  vars = \"General Score\",\n  GS_gst,\n  retain = c(\"user_id\", \"sex\"),\n  what = \"sten\",\n  group_col = \"Group\"\n)\n\nstr(grouping_normalized)\n```\n\n### Create and export *ScoringTable*\n\nExport generated norms in universal format\n\n```{r scoring_table}\nST_csv \u003c- tempfile(fileext = \".csv\")\nGS_scoring \u003c- to_ScoringTable(\n  table = GS_gst,\n  min_raw = 16,\n  max_raw = 80\n)\n\nexport_ScoringTable(\n  table = GS_scoring,\n  out_file = ST_csv,\n  method = \"csv\"\n)\n```\n\n### Create *ScoringTable* from **csv** or **json** file\n\nImport *ScoringTable* from universally readable formats (eg. create **csv**\non basis of published norms)\n\n```csv\n\"sten\",\"M\",\"F\",\"O\"\n1,NA,\"16-22\",NA\n2,\"16-32\",\"23-26\",NA\n3,\"33-36\",\"27-29\",\"16-35\"\n4,\"37-40\",\"30-37\",NA\n5,\"41-47\",\"38-41\",\"36-63\"\n6,\"48-51\",\"42-47\",\"64-68\"\n7,\"52-58\",\"48-49\",NA\n8,\"59-71\",\"50-55\",\"69-80\"\n9,\"72-80\",\"56-59\",NA\n10,NA,\"60-80\",NA\n```\n\n```{r import_scoring_table}\nimported \u003c- import_ScoringTable(\n  source = ST_csv,\n  method = \"csv\",\n  conditions = sex_grouping\n)\n\nscoring_normalized \u003c- normalize_scores_scoring(\n  data = summed_data,\n  vars = \"General Score\",\n  imported,\n  retain = c(\"user_id\", \"sex\"),\n  group_col = \"Group\"\n)\n\nstr(scoring_normalized)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatismike%2Fstenr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatismike%2Fstenr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatismike%2Fstenr/lists"}