I am a very new R user. And for a project I need to estimate a “Semiparametric smooth-coefficient (SPSC)’ model following this paper (here).
I have cross-section data on 1,000 households. The dependent variable is Gross_returns, which is a function of land and labor inputs. In addition, I have 3 risk variables (Risk1, Risk2, Risk3) that enter the production function in some unspecified nonlinear way. My model is
Returns = α(Z) + Landβ1*(Z) + Laborβ2(Z) + ui
Going though an earlier post (here) I understand that I need to use something like
library(tidyverse)
library(readxl)
Data=read_excel("C:/Users/A/Desktop/Data.xlsx")
NP.Ydata <- Data$Ln_Gross_ret
NP.Xdata <- Data[c("Ln_Land", "Ln_Labor")]
NP.Zdata <- Data[c("risk_behavior", "risk_pref", "agt_exper")]
NP.bw.scoef <- npscoefbw(xdat=NP.Xdata, ydat=NP.Ydata, zdat=NP.Zdata)
NP.scoef <- npscoef(NP.bw.scoef,
betas = TRUE,
residuals = TRUE,
errors = TRUE)
I am able to run the above model. However, I have the following questions.
I need the direct, indirect and overall marginal impacts of the risk variables.
I need to add constraints to make the marginal products (elasticities) non-negative. My reference paper says that it uses “quadprog” for this.
Any suggestions for the above questions would be appreciated.
user412914 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.