0

have an issue here:

I have 8 different datasets, combined in a list EE_list.

TFP_EE <- list() # create list for estimation results 
Omegas <- list() # create list for omega results

for(i in 1:length(EE_list)) {
  TFP_EE[[i]] <- prodest::prodestACF(EE_list[[i]]$turn, fX = EE_list[[i]]$l, sX = EE_list[[i]]$tfa, pX = EE_list[[i]]$m, idvar = EE_list[[i]]$ID, timevar = EE_list[[i]]$Year, 
                                        R = 100, cX = NULL, opt = 'DEoptim', theta0 = NULL, cluster = NULL) # estimation model 
  
  Omegas[[i]] <- prodest::omega(TFP_EE[[i]]) # assign results to the list
}

So far, I have created 2 lists with the results of the estimation: TFP_EE - list of the estimation with coefficients, Omegas - list of the results of one coefficient from the estimation.

My datasets in EE_list are named EE_AB, EE_C, EE_FL, etc. What I need is to create a variable in each dataset named EEomegaACF_AB, EEomegaACF_C, EEomegaACF_FL, and assign values from the list Omegas to these variables with respective name, namely if variable EEomegaACF_AB in EE_AB dataset, then values that should be assigned are located in Omegas list with the respective item.

UPD: Here is an example:

ID   Year  x   
1    2011  0.19 
1    2012  0.19 
1    2013  0.21 
1    2014  0.18 
2    2013  0.39 
2    2014  0.15 
2    2015  0.47 
2    2016  0.35 
3    2013  0.30 
3    2015  0.1  
3    2017  0.13 
3    2018  0.78 
4    2011  0.13 
4    2012  0.35 

In my Omegas list, there are 8 objects, something similar to: list(1.82, 1.92, 1.93, 1.83, etc.), what I need is to assign this list values to my datasets, meaning if the dataset is named EE_AB, the values from Omegas with the same name should be assigned to the variable EEomegaACF_AB located in EE_AB dataset. The same should apply to EE_C, EE_H, etc. datasets

ID   Year  x     EEomegaACF_AB
1    2011  0.19     1.82
1    2012  0.19     1.92
1    2013  0.21     1.93 
1    2014  0.18     1.83
2    2013  0.39     etc.
2    2014  0.15 
2    2015  0.47 
2    2016  0.35 
3    2013  0.30 
3    2015  0.1  
3    2017  0.13 
3    2018  0.78 
4    2011  0.13 
4    2012  0.35 
  • [See here](https://stackoverflow.com/q/5963269/5325862) on making a reproducible example that is easier for folks to help with. That includes representative samples of data for us to work with and a clear sense of the desired output – camille Feb 09 '21 at 21:22
  • do not know how to show the practical example since I do not know how to ask for specific elements in my lists – Wadim iLchuk Feb 09 '21 at 21:45

0 Answers0