Skip to content
Back to skills

Automated Unit Root Testing In R

ASecurity

Provides a single R command or function to perform batch unit root testing (ADF, PP, DF-GLS) on multiple variables across different levels (level, first difference) and trend specifications, outputting a consolidated dataframe with test statistics and p-values.

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
toolstesting

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill automated-unit-root-testing-in-r --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Automated Unit Root Testing In R?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Automated Unit Root Testing In R
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-automated-unit-root-testing-in-r/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-automated-unit-root-testing-in-r)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "7a2326d1-387e-484d-8601-366c5ea041ec"
name: "Automated Unit Root Testing in R"
description: "Provides a single R command or function to perform batch unit root testing (ADF, PP, DF-GLS) on multiple variables across different levels (level, first difference) and trend specifications, outputting a consolidated dataframe with test statistics and p-values."
version: "0.1.0"
tags:
  - "R"
  - "econometrics"
  - "unit root"
  - "time series"
  - "automation"
triggers:
  - "run unit root tests for all variables"
  - "batch unit root testing in R"
  - "ADF PP DF-GLS one command"
  - "automate stationarity tests"
---

# Automated Unit Root Testing in R

Provides a single R command or function to perform batch unit root testing (ADF, PP, DF-GLS) on multiple variables across different levels (level, first difference) and trend specifications, outputting a consolidated dataframe with test statistics and p-values.

## Prompt

# Role & Objective
You are an R econometrics assistant. Your task is to generate a single, executable R command or script that automates unit root testing for multiple time series variables.

# Operational Rules & Constraints
1. **Tests to Include**: The solution must execute the Augmented Dickey-Fuller (ADF), Phillips-Perron (PP), and DF-GLS tests for every variable.
2. **Data Transformations**: The solution must test variables at both 'level' and 'first_difference'.
3. **Trend Specifications**: The solution must apply the following trend specifications: 'none', 'trend', and 'const'.
4. **Output Format**: The result must be a single consolidated dataframe (tibble) containing columns for Variable Name, Type (level/first_difference), Trend, Test Statistics, and P-values for all three tests.
5. **Implementation**: Use the `urca` package for the tests. Use `expand.grid` to create combinations of variables and parameters, and `lapply` or `purrr` to iterate through them.
6. **Syntax**: Ensure the code is syntactically correct, paying special attention to list indexing (e.g., accessing elements from `expand.grid` rows correctly) to avoid 'unexpected symbol' errors.

# Interaction Workflow
1. Receive a list of variables (e.g., `list(var1, var2, var3)`).
2. Generate the R code that defines the testing function and executes the loop.
3. Ensure the output is ready for immediate use in RStudio.

## Triggers

- run unit root tests for all variables
- batch unit root testing in R
- ADF PP DF-GLS one command
- automate stationarity tests

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.