Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Change logit structure for cycling and walking #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions R/calculate_logit_inconv_endog.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ calculate_logit_inconv_endog = function(prices,
## joins the df containing the prices with the df containing the logit exponents
df <- merge(prices, logit_exponent,
by=intersect(names(prices), names(logit_exponent)), all.x = TRUE)

## joins the previous df with gathe df containing the inconvenience costs
df <- merge(df, final_pref, by=intersect( names(df),names(final_pref)), all.y=TRUE)
## delete entries have tot_price NA (e.g. 1900 BEV)
df <- df[ !(is.na(tot_price))]
## entries that are not present in the mix have non_fuel_price == 0, but also Walk and Cycle: delete all the not-present in the mix options
df <- df[(non_fuel_price>0)|(non_fuel_price==0 & subsector_L3 %in% c("Walk", "Cycle"))]
## needs random lambdas for the sectors that are not explicitly calculated
df <- df[ is.na(logit.exponent), logit.exponent := -10]

Expand Down Expand Up @@ -134,7 +131,7 @@ calculate_logit_inconv_endog = function(prices,
## delete entries have tot_price NA (e.g. 1900 BEV)
df <- df[ !(is.na(tot_price))]
## entries that are not present in the mix have non_fuel_price == 0, but also Walk and Cycle: delete all the not-present in the mix options
df <- df[(non_fuel_price>0)|(non_fuel_price==0 & subsector_L3 %in% c("Walk", "Cycle"))]
df <- df[(non_fuel_price>0)|(non_fuel_price==0 & subsector_L1 %in% c("Walk", "Cycle"))]
## needs random lambdas for the sectors that are not explicitly calculated
df <- df[ is.na(logit.exponent), logit.exponent := -10]

Expand Down
5 changes: 5 additions & 0 deletions edgetRansport.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

Expand Down