
Read Me File for data summary, Bayesian estimation of ordinal probit, and 
ordinal quantile models, and reproducing the figures.

Paper Title: Do Determinants of EV Purchase Intent vary across 
the Spectrum? Evidence from Bayesian analysis of US survey data

Authors: Nafisa Lohawala (Resources for the Future) and Mohammad Arshad 
Rahman (Indian Institute of Technology Kanpur). In case of any questions,
please contact the corresponding author, Mohammad Arshad Rahman,
at marshad@iitk.ac.in; arshadrahman25@gmail.com
**************************************************************************

		    ALL CODES are in MATLAB

**************************************************************************
Data Summary and Results from Ordinal Probit Model
**************************************************************************


-------------------------------------------------------
       Wave 89, April 20-21, 2021 Survey
-------------------------------------------------------

1) Run the file "EV_OP_W89Script.m" within the folder 
"Ordinal Probit\Wave89". 

This will give the first two columns of Table 1 
(data summary), first two columns of Table 2 (results 
from ordinal probit model), and the first four
columns of Table 3 (covariate effects).

All these results are stored in the file 
"W89ProbitResults.txt"


-------------------------------------------------------
       Wave 108, May 2-8, 2022 Survey
-------------------------------------------------------

2) Run the file "EV_OP_W108Script.m" within the folder 
"Ordinal Probit\Wave108". 

This will give columns 3-4 of Table 1 (data summary), 
columns 3-4 of Table 2 (results from ordinal probit model), 
and columns 5-8 of Table 3 (covariate effects). 

All these results are stored in the file 
"W108ProbitResults.txt"

-------------------------------------------------------
       Wave 128, May 30-June 4, 2023 Survey
-------------------------------------------------------

3) Run the file "EV_OP_W128Script.m" within the folder 
"Ordinal Probit\Wave128". 

This will give columns 5-6 of Table 1 (data summary), 
columns 5-6 of Table 2 (results from ordinal probit model), 
and columns 9-12 of Table 3 (covariate effects). 

All these results are stored in the file 
"W128ProbitResults.txt"


-------------------------------------------------------
       		Figure 2, Bar Graph
-------------------------------------------------------

1) The file "BarGraphEV.m" within the folder "BarGraph" 
uses elements of data summary to produce Figure 2. 
This file is self-contained.


**************************************************************************
         Results from Ordinal Quantile Models
**************************************************************************


-------------------------------------------------------
       Wave 89, April 20-21, 2021 Survey
-------------------------------------------------------



1) Run the file "EV_OQ_W89Script.m" within the folder 
"Ordinal Quantile\Wave89". To select the quantile, change
the value of "p" in line 260. For example, if you want to 
reproduce the results for the 20th quantile, set "p=0.20".
For the 50th quantile, set "p=0.50"; and for the 80th 
quantile, set "p=0.80".

This will give columns 1-6 of Table 4, posterior mean and 
standard deviation of the parameters for each quantile 
(results from ordinal quantile model), and the covariate 
effects for all variables. Selected covariate effects are
presented in the first panel of Table 5. 

Results for the 20th, 50th, and 80th quantiles are stored 
in the file "W89ProbitResults.txt"

The file "W89-AllQuantiles.txt" contains the posterior 
summary (posterior mean and standard deviation) of all
parameters and covariate effects from 5th to 95th quantiles,
with increments of 5 quantiles. The covariates effects from 
this output is stored in the file "CEPlotScript.m" to plot
the covariate effects in Figure 3.



-------------------------------------------------------
       Wave 108, May 2-8, 2022 Survey
-------------------------------------------------------


2) Run the file "EV_OQ_W108Script.m" within the folder 
"Ordinal Quantile\Wave108". To select the quantile, change
the value of "p" in line 260. For example, if you want to 
reproduce the results for the 20th quantile, set "p=0.20".
For the 50th quantile, set "p=0.50"; and for the 80th 
quantile, set "p=0.80".

This will give columns 7-12 of Table 4, the posterior mean and 
the standard deviation of the parameters for each quantile 
(results from the ordinal quantile model), and the covariate 
effects for all variables. Selected covariate effects are
presented in the third panel of Table 5. 

Results for the 20th, 50th, and 80th quantiles are stored 
in the file "W108QuantileResults.txt"


-------------------------------------------------------
       Wave 128, May 30-June 4, 2023 Survey
-------------------------------------------------------


3) Run the file "EV_OQ_W128Script.m" within the folder 
"Ordinal Quantile\Wave128". To select the quantile, change
the value of "p" in line 260. For example, if you want to 
reproduce the results for the 20th quantile, set "p=0.20".
For the 50th quantile, set "p=0.50"; and for the 80th 
quantile, set "p=0.80".

This will give columns 13-18 of Table 4, the posterior mean and 
the standard deviation of the parameters for each quantile 
(results from the ordinal quantile model), and the covariate 
effects for all variables. Selected covariate effects are
presented in the third panel of Table 5. 

Results for the 20th, 50th, and 80th quantiles are stored 
in the file "W128QuantileResults.txt"

The file "W128-AllQuantiles.txt" contains the posterior 
summary (posterior mean and standard deviation) of all
parameters and covariate effects from 5th to 95th quantiles,
with increments of 5 quantiles. The covariate effects from 
this output is stored in the file "CEPlotScript.m" to plot
the covariate effects in Figure 3.

-------------------------------------------------------
          Figure 3, Plot Covariate Effects
-------------------------------------------------------

1) The file "CEPlotSCript.m" within the folder 
"Ordinal Quantile\CEPlotCodes" can be used to recreate 
Figure 3. This file contains all the covariate effects 
from the April 2021 and May-June 2023 survey for all 
quantiles from 5th to 95th quantiles, in increments
of 5 quantiles. This file is self-contained.









