Hanifa Pilvar
Hanifa Pilvar

Reputation: 11

GMM in R using sampling weights

I want to perform GMM in R and specify sampling weights but I do not know how to do it. I am using gmm from gmm package and all weight options are about weighting matrix of GMM estimation. Can you please help me?

Here is what I have tried so far:

# Required packages
library(gmm)


# Data
df<-data.frame(y=c(1,0,1,1,1,0,0,1), x= c(20,12,13,15,19,21,10,12),weight=c(1,0.5,1,0.75,1,1,0.25,1))

# Running gmm
gmm(y~x,~x, weight=weight,data=df)

but it does not work.

Upvotes: 1

Views: 37

Answers (0)

Related Questions