CES production function application problem I'm currently trying to do some estimations using the micEconCES package in R by Henningsen/Henningsen (2011). My issue is that I am not very familiar with R and I'm trying to implement my own dataset to get the estimations with the package. They authors of the paper created this data set for the estimations. 

R&gt; set.seed( 123 ) 
R&gt; cesData &lt;- data.frame(x1 = rchisq(200, 10), x2 = rchisq(200, 10), x3 = rchisq(200, 10), x4 = rchisq(200, 10) ) 
R&gt; cesData$y2 &lt;- cesCalc( xNames = c( "x1", "x2" ), data = cesData, + coef = c( gamma = 1, delta = 0.6, rho = 0.5, nu = 1.1 ) ) 
R&gt; cesData$y2 &lt;- cesData$y2 + 2.5 * rnorm( 200 )
R&gt; cesData$y3 &lt;- cesCalc(xNames = c("x1", "x2", "x3"), data = cesData, coef = c( gamma = 1, delta_1 = 0.7, delta = 0.6, rho_1 = 0.3, rho = 0.5, + nu = 1.1), nested = TRUE ) 
R&gt; cesData$y3 &lt;- cesData$y3 + 1.5 * rnorm(200) 
R&gt; cesData$y4 &lt;- cesCalc(xNames = c("x1", "x2", "x3", "x4"), data = cesData, coef = c(gamma = 1, delta_1 = 0.7, delta_2 = 0.6, delta = 0.5, rho_1 = 0.3, rho_2 = 0.4, rho = 0.5, nu = 1.1), nested = TRUE ) 
R&gt; cesData$y4 &lt;- cesData$y4 + 1.5 * rnorm(200)


The ﬁrst line sets the“seed”for the random number generator so that these examples can be replicated with exactly the same data set. The second line creates a data set with four input variables (called x1, x2, x3, and x4) that each have 200 observations and are generated from random χ2 distributions with 10 degrees of freedom. The third, ﬁfth, and seventh commands use the function cesCalc, which is included in the micEconCES package, to calculate the deterministic output variables for the CES functions with two, three, and four inputs (called y2, y3, and y4, respectively) given a CES production function. Now in my paper I'm trying to estimate the CES function for the U.S. at the Aggregate Level for the two input case with capital and labor. So what I did is I gathered data from the World Bank Data Base from 1990-2015, where I used Gross Fixed Capital Formation for capital and total Labor Force for Labor.

The authors did f.e. a non linear estimation the following way

R&gt; cesNls &lt;- nls( y2 ~ gamma * ( delta * x1^(-rho) + (1 - delta) * x2^(-rho) )^(-phi / rho), + data = cesData, start = c( gamma = 0.5, delta = 0.5, rho = 0.25, phi = 1 ) ) 
R&gt; print( cesNls )


Now I want the exact same thing for my own data Set which is called Data_Extract_From_World_Development_Indicators. So what I did is firstly

R&gt; ceslan &lt;- cesCalc( xNames = c( "GrossFixedCapitalFormation", "LaborForce" ), data = Data_Extract_From_World_Development_Indicators, coef = c( gamma = 1, delta = 0.6, rho = 0.5, nu = 1.1 ) )


So i replicated

R&gt; cesData$y2 &lt;- cesCalc( xNames = c( "x1", "x2" ), data = cesData, coef = c( gamma = 1, delta = 0.6, rho = 0.5, nu = 1.1 ) )


All I did was changing the name of the Dataset and replaced x1 and x2 with my two variables for capital and Labor.

Afterwards I tried to do the non linear estimation

R&gt; cesulan &lt;- nls(y2 ~ gamma * (delta * GrossFixedCapitalFormation^(-rho) + (1-delta)*LaborForce^(-rho))^(-phi / rho), data = Data_Extract_From_World_Development_Indicators, start = c(gamma = 0.5, delta = 0.5, rho = 0.25, phi = 1) )


Now this is where my Problem is: I dont know what variable is meant to be y2 in my dataset. I can see in the formula that y2 ~ gamma *... so ist plotted against the rest of the term, but I dont know what Kind of value I need to plug in there. Does anyone have any advice?
Your y2 needs to be the output associated produced with those inputs. Given that you have a CES production function and you use World Bank Country data as inputs, you need output of the countries in that specific year. Typically we use GDP as a measure of output at country level. You can get it a.o. from the World Bank.