Import Excel Datasheet

Dear All,

I will run an estimation of a DSGE model, my data are in an Excel Datasheet. I have tried different ways in order to import these data, but it doesn’t work. Can somebody help me, please?

Bests
laura

Hi,

Please give us more details about your problem (at least the error message and maybe your MOD-file). We can’t provide any help otherwise.

Sébastien

I’ll send you my Excel sheet, my .mod file and the following error in running it.

Errors:
??? Subscripted assignment dimension mismatch.

Error in ==> read_variables at 69
dyn_data_01(:,dyn_i_01) = dyn_tmp_01;

Error in ==> dynare_estimation_1 at 237
rawdata = read_variables(options_.datafile,options_.varobs,],options_.xls_sheet,options_.xls_range);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> model_1b at 142
dynare_estimation(var_list_);

Error in ==> dynare at 102
evalin(‘base’,fname) ;
If you can help me, it could be great.

Thanks in advance

laura
model_1b.mod (1.08 KB)
CH_data_1.xls (39.5 KB)

Hi Laura, sorry for bothering you, but I want to ask you if you have learned how to read (or to import) data from an excel file. I will be very grateful if you could help me with this.

Thanks

Pablo

[quote=“laura”]Dear All,

I will run an estimation of a DSGE model, my data are in an Excel Datasheet. I have tried different ways in order to import these data, but it doesn’t work. Can somebody help me, please?

Bests
laura[/quote]

Hi,

The Excel file posted by Laura was wrong: the first line should contain the variables names, and the data should begin at the second line. Hence the crash.

It is perfectly possible to use an Excel file for estimation, with the options “datafile”, “xls_sheet” and “xls_range” of the “estimation” command. Please look at the reference manual for more details.

Best,