Many thanks, Here is the model that I'm working with. proc model data = SS hessian=cross; prod = a0 + a1*x1 + a2*x2 + a3*x1**2 + a4*x2**2; risk=(x1**b1)*(x2**b2); g_price = 5; mu_pi=(g_price*prod – pricex1*x1 – pricex2*x2)*x3; tmu_pi = sum(mu_pi); the question is here-how to sum mu_pi by hhld id? sigma_pi =g_price*risk*x3; tsigma_pi = sum(sigma_pi); how to sum sigma_pi by hhld id? tsigma2_pi = tsigma_pi**2; AR = d0 + d1*tmu_pi + 0.5*d2*tmu_pi**2; DR = -d1 - d2*tmu_pi + AR**2; eq.techn = y/ risk - prod_fu /risk; eq.fert=a1 + a3*x1*2 – pricex1/g_price +((-AR*tsigma_pi + 0.5*DR*tsigma2_pi*(d3))/(1 + 0.5*DR*tsigma2_pi))*risk*b1/x1; eq.herb = a2 + a4*x2*2 – pricex2/g_price + ((-AR*tsigma_pi + 0.5*DR*tsigma2_pi*(d3))/(1 + 0.5*DR*tsigma2_pi))*risk*b2/x2; endogenous y x1 x2; fit techn fert herb / fiml; run; In the above model, parameters to be estimated are: a0, a1, a2, a3, a4, b1, b2, d0, d1, d2 and d3 and variables that exist within my data are: x1, x2, x3 and y. In my actual model, there are some additional exogenous variables.

... View more