Type: Package
Title: Simple Generalizability Theory for Crossed and Nested Designs
Version: 0.1.0
Description: Provides a small, beginner-friendly interface for estimating variance components in simple generalizability theory designs. The package currently supports a fully crossed persons-by-items design and a simple items-within-person nested design, along with design-study summaries for relative and absolute decisions.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.2
NeedsCompilation: no
Packaged: 2026-03-15 10:16:45 UTC; Ujjwa
Author: Ujjwal Tyagi [aut, cre]
Maintainer: Ujjwal Tyagi <ujjwaltyagiii@gmail.com>
Repository: CRAN
Date/Publication: 2026-03-19 13:50:10 UTC

gtheoryr: Simple Generalizability Theory for R

Description

Small, beginner-friendly helpers for estimating variance components in simple generalizability theory designs. The package currently supports:


Design Study for a Nested Items-within-Person Design

Description

Computes a simple reliability summary for a proposed number of nested items per person.

Usage

dstudy_nested_ip(gstudy, n_items = gstudy$n_items)

Arguments

gstudy

A result from gstudy_nested_ip().

n_items

Number of nested items per person in the proposed design.

Value

An object of class "dstudy_gtheoryr".

Examples

nested_scores <- data.frame(
  person = c("P1", "P1", "P2", "P2", "P3", "P3"),
  item = c("P1_I1", "P1_I2", "P2_I1", "P2_I2", "P3_I1", "P3_I2"),
  score = c(8, 6, 5, 4, 9, 7)
)

gs_nested <- gstudy_nested_ip(
  nested_scores,
  person = "person",
  item = "item",
  score = "score"
)
dstudy_nested_ip(gs_nested, n_items = 4)

Design Study for a Crossed Persons-by-Items Design

Description

Computes relative error, absolute error, a generalizability coefficient, and a phi coefficient for a proposed number of items.

Usage

dstudy_pxi(gstudy, n_items = gstudy$n_items)

Arguments

gstudy

A result from gstudy_pxi().

n_items

Number of items in the proposed design.

Value

An object of class "dstudy_gtheoryr".

Examples

scores <- data.frame(
  person = rep(c("P1", "P2", "P3"), each = 3),
  item = rep(c("I1", "I2", "I3"), times = 3),
  score = c(8, 7, 9, 5, 4, 6, 7, 6, 8)
)

gs <- gstudy_pxi(scores, person = "person", item = "item", score = "score")
dstudy_pxi(gs, n_items = 6)

Estimate Variance Components for a Nested Items-within-Person Design

Description

Estimates ANOVA mean squares and variance components for a simple balanced nested design in which each person has their own set of items.

Usage

gstudy_nested_ip(data, person, item, score)

Arguments

data

A data frame containing one row per observation.

person

Name of the person column.

item

Name of the nested item column.

score

Name of the numeric score column.

Value

An object of class "gstudy_gtheoryr".

Examples

nested_scores <- data.frame(
  person = c("P1", "P1", "P2", "P2", "P3", "P3"),
  item = c("P1_I1", "P1_I2", "P2_I1", "P2_I2", "P3_I1", "P3_I2"),
  score = c(8, 6, 5, 4, 9, 7)
)

gs_nested <- gstudy_nested_ip(
  nested_scores,
  person = "person",
  item = "item",
  score = "score"
)
gs_nested

Estimate Variance Components for a Crossed Persons-by-Items Design

Description

Estimates ANOVA mean squares and variance components for a fully crossed random-effects persons-by-items design.

Usage

gstudy_pxi(data, person, item, score)

Arguments

data

A data frame containing one row per person-item observation.

person

Name of the person column.

item

Name of the item column.

score

Name of the numeric score column.

Value

An object of class "gstudy_gtheoryr".

Examples

scores <- data.frame(
  person = rep(c("P1", "P2", "P3"), each = 3),
  item = rep(c("I1", "I2", "I3"), times = 3),
  score = c(8, 7, 9, 5, 4, 6, 7, 6, 8)
)

gs <- gstudy_pxi(scores, person = "person", item = "item", score = "score")
gs