I am trying to check if the difference between two coefficients extracted from two equation is greater than zero using the deltaMethod in R
set.seed(111)
y1.predict <- rnorm(12,3,1)
y1.n1 <- c(1000, 2000, 3000, 4000,0,0,0,0,1000,4000,3000,3000)
y1.n2 <- c(0,0,0,0,1000, 2000, 3000, 4000,4000,1000,2000,2000)
y2.predict <- rnorm(16,5,1)
y2.n1 <- c(1000, 2000, 3000, 4000,0,0,0,0,1000,4000,3000,3000,1000,0,2500,4000)
y2.n2 <- c(0,0,0,0,1000, 2000, 3000, 4000,4000,1000,2000,2000,0,4000,2500,0)
df1 <- data.frame(y1.predict, y1.n1,y1.n2)
df2 <- data.frame(y2.predict, y2.n1,y2.n2)
y1 <- lm(y1.predict ~ n1 + n2)
y2 <- lm(y2.predict ~ n1 + n2)
#Typical use of delta method when comparing coefficients from same regression. Here I am trying to see if n1 - n2 > 0
g1.delta <- deltaMethod(y1,"(-n1) - (-n2)")
What I need is to compare the coefficient of n1 of y1 and n2 of y2 using the delta method. How can I do this?