<p>I estimated a gmm model using pgmm() of the plm package, but received the following error term:</p>
<pre><code>Error in cbind(yX1[[i]], V1) : number of rows of matrices must match (see arg 2)
</code></pre>
<p>My Model looks like this:</p>
<pre><code>pgmm(X1 ~ X2 +X3 +X4 +X5| X6 +X7 +X8 +X9 +X10 +X11 +X12, data= mydata,                           
 effect = &quot;twoways&quot;, model = &quot;twosteps&quot;, transformation = &quot;ld&quot;)
</code></pre>
<p>The Data and my R Script can be found here:</p>
<p><a href="https://drive.google.com/drive/folders/1_DtL9-rOZ8rXO6RPOHfeByD_1GnWxXK9?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/drive/folders/1_DtL9-rOZ8rXO6RPOHfeByD_1GnWxXK9?usp=sharing</a></p>

CC BY-SA 4.0
2020-11-10T13:07:47.363Z
the error seems to be self explanatory - as to what actually causes that row mismatch without you providing minimal working example with data not much can be said.
1muflon1
CC BY-SA 4.0
2020-11-10T13:40:13.647Z
@1muflon1 I thought the same and checked the number of rows with nrow(), but everything seemed ok... If you want to check my r script and data I can give you access...
KC15
CC BY-SA 4.0
2020-11-10T13:46:20.300Z
how could you check that? yX1 and V1 are created internally by the function. Also just add the data and script to your Q so anyone can access it and potentially help you. Also you don’t need to include whole script just the minimum necessary to replicate the error. In this case that would be all packages you run, any transformation of the data plus the model specification that is already up there plus the data itself
1muflon1
CC BY-SA 4.0
2020-11-10T15:27:03.593Z
@1muflon1 you should have access to my script and data with the link in the question ;)
KC15
CC BY-SA 4.0
2020-11-11T12:36:34.720Z
@LucasLeonhard: Hi: You're probably better off sending your question to the R tag in R stackoverflow.
mark leeds
CC BY-SA 4.0
2021-01-30T18:44:49.640Z
@LucasLeonhard, have you solved the problem, similar to which I have right now?
Wadim iLchuk
<econometrics><paneldata><r>
Error in cbind(yX1[[i]], V1) : number of rows of matrices must match (see arg 2) in r
KC15
# Error in cbind(yX1[[i]], V1) : number of rows of matrices must match (see arg 2) in r

(Asked by: username_0 on 2020-11-10)

I estimated a gmm model using pgmm() of the plm package, but received the following error term:

```
Error in cbind(yX1[[i]], V1) : number of rows of matrices must match (see arg 2)

```

My Model looks like this:

```
pgmm(X1 ~ X2 +X3 +X4 +X5| X6 +X7 +X8 +X9 +X10 +X11 +X12, data= mydata,                           
 effect = "twoways", model = "twosteps", transformation = "ld")

```

The Data and my R Script can be found here:

<https://drive.google.com/drive/folders/1_DtL9-rOZ8rXO6RPOHfeByD_1GnWxXK9?usp=sharing>

**Tags:** econometrics, paneldata, r

> **Comments:**
> **username_1**: the error seems to be self explanatory - as to what actually causes that row mismatch without you providing minimal working example with data not much can be said.  
> **username_0**: @username_1 I thought the same and checked the number of rows with nrow(), but everything seemed ok... If you want to check my r script and data I can give you access...  
> **username_1**: how could you check that? yX1 and V1 are created internally by the function. Also just add the data and script to your Q so anyone can access it and potentially help you. Also you don’t need to include whole script just the minimum necessary to replicate the error. In this case that would be all packages you run, any transformation of the data plus the model specification that is already up there plus the data itself  
> **username_0**: @username_1 you should have access to my script and data with the link in the question ;)  
> **username_2**: @LucasLeonhard: Hi: You're probably better off sending your question to the R tag in R stackoverflow.  
> **username_3**: @LucasLeonhard, have you solved the problem, similar to which I have right now?  

---

## 0 answers

