Page 1 of 1

error "undefined columns selected"

Posted: 31 Oct 2023, 15:02
by lemontree
Hi,

I have transformed the data for analyzing using the MDCEV model. I received the error Error in `[.data.frame`(database, , apollo_control$indivID) :
undefined columns selected
.

Could you please help me to look at it?


# Set working directory
> setwd(".....")
>
> # Initialise code
> apollo_initialise()
Apollo ignition sequence completed
>
> ### Set core controls
> apollo_control = list(
+ modelName = "MDCEV_no_outside_good",
+ modelDescr = "MDCEV model on time use data, alpha-gamma profile, no outside good and constants only in utilities",
+ indivID = "indivID",
+ outputDirectory = "output"
+ )
>
> database = read.csv("data/derived/meatce_model.csv",header=TRUE)
>
> # ################################################################# #
> #### DEFINE MODEL PARAMETERS ####
> # ################################################################# #
>
> ### Vector of parameters, including any that are kept fixed in estimation
> apollo_beta = c(alpha_base = 0,
+ gamma_beef = 1,
+ gamma_pork = 1,
+ gamma_chicken = 1,
+ gamma_fish = 1,
+ gamma_plant = 1,
+ delta_beef = 1,
+ delta_pork = 1,
+ delta_chicken = 1,
+ delta_fish = 1,
+ delta_plant = 1,
+ sig = 1)
>
> ### Vector with names (in quotes) of parameters to be kept fixed at their starting value in apollo_beta, use apollo_beta_fixed = c() if none
> apollo_fixed = c("delta_beef", "sig")
>
> # ################################################################# #
> #### GROUP AND VALIDATE INPUTS ####
> # ################################################################# #
>
> apollo_inputs = apollo_validateInputs()
Error in `[.data.frame`(database, , apollo_control$indivID) :
undefined columns selected

>

Re: error "undefined columns selected"

Posted: 06 Nov 2023, 08:42
by stephanehess
Hi

does the column indivID exist in your data? You need to use the ID column from your data, which might be a different name

Stephane

Re: error "undefined columns selected"

Posted: 30 Nov 2023, 14:29
by lemontree
Many thanks, that solves the problem!