Code Monkey home page Code Monkey logo

Comments (4)

bashtage avatar bashtage commented on August 10, 2024

Hi,

Can you provide me with a copy-pastable example that raises the issue?

Thanks,
Kevin

from linearmodels.

bashtage avatar bashtage commented on August 10, 2024
import linearmodels as plm
from linearmodels.datasets import wage_panel

df = wage_panel.load()
df = df.set_index(["nr","year"])
idx = df.index
df = df.reset_index()
df.index=idx
fm = 'lwage ~ C(year)*educ + union + EntityEffects'
model2 = plm.PooledOLS.from_formula(formula=fm,data=df).fit(cov_type='clustered',debiased=True, cluster_entity=True)

from linearmodels.

SPDA36 avatar SPDA36 commented on August 10, 2024

Kevin,
Below is the copy-paste code.

Python implementation: CPython
Python version : 3.10.9
IPython version : 8.10.0

Compiler : MSC v.1916 64 bit (AMD64)
OS : Windows
Release : 10
Machine : AMD64
Processor : Intel64 Family 6 Model 154 Stepping 3, GenuineIntel
CPU cores : 20
Architecture: 64bit
linearmodels: 4.31

import linearmodels as plm
from linearmodels.datasets import wage_panel

df = wage_panel.load()
df = df.set_index(["nr","year"])
idx = df.index
df = df.reset_index()
df.index=idx
fm = 'lwage ~ C(year)*educ + union + EntityEffects'
model2 = plm.PooledOLS.from_formula(formula=fm,data=df).fit(cov_type='clustered',debiased=True, cluster_entity=True)

null = 'C(year)[T.1984]:educ = 0'
model2.wald_test(formula=null)

FormulaSyntaxError: Unknown operator '['.
C(year)⧛[⧚T.1987]:educ

null = 'C(year,Treatment(1984)):educ = 0'
model2.wald_test(formula=null)

FormulaSyntaxError: Unknown operator ':'.
C(year,Treatment(1984))⧛:⧚educ = 0

from linearmodels.

bashtage avatar bashtage commented on August 10, 2024

I think you need to escale terms that are not valid Python, e.g.,

null = '`C(year,Treatment(1984)):educ` = 0'

Note the ticks around the entire variable name. I'll need to check that this works, but it should.

Note: There was a recently fixed regression in formulaic that might affect escaping. This should be fixed in the next release of formulaic.

from linearmodels.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.