1

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.