Statistics
AuraScore 87/100

Educational Assessment Psychometric Reliability and Factor Analysis Script

Build an R analysis script to validate psychometric survey instruments, internal consistency, and exploratory factor structures.

Use this template when evaluating survey or assessment scales in education, research, or organizational psychology. It generates an executable R script to compute Cronbach's alpha, McDonald's omega, and exploratory factor analysis.

Template

Role: Senior Psychometrician and Quantitative Educational Measurement Specialist.

Context

  • Survey instrument: {{survey_instrument}}
  • Evaluated respondents: {{target_respondents}}
  • Scale measurement format: {{likert_scale_levels}}
  • Theoretical construct count: {{dimension_count}}
  • Data file location: {{data_source_path}}
  • Imputation protocol: {{missing_data_strategy}}

Task

Develop an R script that ingests response data from {{data_source_path}}, executes comprehensive item-level psychometric diagnostics, evaluates internal consistency, and fits an exploratory factor model for {{survey_instrument}} administered to {{target_respondents}}.

Method

  1. Load core psychometric packages (psych, lavaan, GPArotation, tidyverse) with version checks.
  2. Construct data intake pipeline reading {{data_source_path}} with automated data validation.
  3. Execute preprocessing and handle non-responses using {{missing_data_strategy}} appropriate for {{likert_scale_levels}} data.
  4. Compute item-level descriptive statistics, skewness, kurtosis, and item-rest correlations.
  5. Calculate internal consistency coefficients including Cronbach's alpha and McDonald's hierarchical omega.
  6. Perform Bartlett's test of sphericity and Kaiser-Meyer-Olkin (KMO) measure of sampling adequacy.
  7. Execute Exploratory Factor Analysis (EFA) targeting {{dimension_count}} factors with polychoric correlation matrices.
  8. Apply oblimin or varimax factor rotation, outputting standardized loadings, communalities, and model fit indices.

Constraints

  • Code MUST execute successfully in base R / R 4.2+ using standard tidyverse and psych ecosystems.
  • Script MUST handle ordinal Likert-scale properties via polychoric correlation matrix calculations.
  • MUST NOT suppress or hide item loadings below standard retention thresholds without explicit log warnings.
  • Provide exhaustive commentary explaining psychometric interpretative thresholds (e.g., KMO > 0.70, Alpha > 0.80).

Output format

Provide a standalone, fully runnable R script (.R) organized into:

  1. Global Constants & Parameter Setup utilizing {{dimension_count}} and {{missing_data_strategy}}.
  2. Data Ingestion & Sanitization Pipeline (min 20 lines).
  3. Scale Reliability & Internal Consistency Function Suite (min 30 lines).
  4. Factor Analytic Engine & Model Evaluation Routine (min 35 lines).
  5. Summary Output Dispatcher printing clear diagnostic tables.

Self-review

  • Confirm polychoric matrix calculation is utilized when handling {{likert_scale_levels}}.
  • Check that {{dimension_count}} correctly drives the factor extraction routine.
  • Ensure clear error messaging if data rows contain complete column missingness.
AuraScore breakdown
87/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification14/14 · Strong

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

data-analytics
data-statistics
research-productivity-operations
statistics
rstats
psychometrics