FixedEffects / FixedEffectModels.jl

Fast Estimation of Linear Models with IV and High Dimensional Categorical Variables
Other
225 stars 46 forks source link

Using r2 as a regression name conflicts with r2 (r-squared?) #248

Closed eloualiche closed 10 months ago

eloualiche commented 10 months ago

I am used to name different regression r1, r2, ..., rn to print them later using regtable.

I think a bug showed up recently because this runs

using DataFrames, RDatasets, FixedEffectModels
df = dataset("plm", "Cigar")
r1 = reg(df, @formula(Sales ~ NDI + fe(State) + fe(Year)), Vcov.cluster(:State), weights = :Pop)

But this errors

r2 = reg(df, @formula(Sales ~ NDI + fe(State) + fe(Year)), Vcov.cluster(:State), weights = :Pop)
ERROR: cannot assign a value to imported variable FixedEffectModels.r2 from module Main
Stacktrace:
 [1] top-level scope
   @ REPL[313]:1
matthieugomez commented 10 months ago

issue not reproductible