felm command without control variable


I am curious about something regarding the felm command.

I want to run a very simple IV model where the variable D is instrumented by one varibale say Z and without any control variable. If I use the old syntax I would write:

late<- felm(Y~D, iv=list(D~Z)) 

it works fine.

But If I used the recommended and new syntax:

late2<- felm(Y~D|0|(D~Z)|0) 
stargazer(late2, type="text", title="LATE effect"

I get the following message:

Error in chol.default(mat[ok, ok]) : 'a' must have dims > 0
Error in chol2inv(ch) : 
  element (1, 1) is zero, so the inverse cannot be computed

If I add a control variable though it works again:

late3<- felm(Y~X|0|(D~Z+X)|0) 
stargazer(late2, type="text", title="LATE effect"

Does it mean that the new syntax of felm does not allow to use an IV without control variables? That's annoying.


Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down that page.

A few of your commands are incomplete, so it's hard to get help from the community. Also, don't assume that we've heard of that function. Can you reference the package and versions, etc.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.