easystats / easystats/parameters

`format_parameters()` edge cases

Open
#502 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug :bug:
Dominant language
R
Stars
499
Forks
45
Avg merge
3d 1h
Merged PRs (30d)
3

Description

library(plm)
data("EmplUK", package = "plm")

## Arellano and Bond (1991), table 4 col. b 
z1 <- pgmm(log(emp) ~ lag(log(emp), 1:2) + lag(log(wage), 0:1)
           + log(capital) + lag(log(output), 0:1) | lag(log(emp), 2:99),
           data = EmplUK, effect = "twoways", model = "twosteps")

parameters::format_parameters(z1)
#>             lag(log(emp), 1:2)1             lag(log(emp), 1:2)2 
#>    "lag(emp [lag(log, 1] * 2)1"    "lag(emp [lag(log, 1] * 2)2" 
#>            lag(log(wage), 0:1)0            lag(log(wage), 0:1)1 
#>   "lag(wage [lag(log, 0] * 1)0"   "lag(wage [lag(log, 0] * 1)1" 
#>                    log(capital)          lag(log(output), 0:1)0 
#>                 "capital [log]" "lag(output [lag(log, 0] * 1)0" 
#>          lag(log(output), 0:1)1                            1979 
#> "lag(output [lag(log, 0] * 1)1"                          "1979" 
#>                            1980                            1981 
#>                          "1980"                          "1981" 
#>                            1982                            1983 
#>                          "1982"                          "1983" 
#>                            1984 
#>                          "1984"

Created on 2021-05-26 by the reprex package (v2.0.0)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the parameters::format_parameters(z1) example from the issue with the plm package and EmplUK data. Inspect how the displayed lag() and log() expressions are formatted, then use the issue's expected edge-case behavior to define corrected parameter labels and verify the output no longer contains malformed expressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.