spool file[PEGtfpCode.out] rem rem Hydroelectric Productivity Code rem rem November 2016 rem rem Data and Results ending in 2014 rem rem Client: OEB RE OPG rem load file[pegdata1] rem ================================================================ rem Capital Cost, Quantity and Price rem 1. ROE, Interest Rates and Return on Capital rem 2. Construction Cost Indexes as basis for Asset Price rem 3. Calculate Captial Quantity, Price and Cost using two methods rem a. Straight-Line methods: Cost of Service rem b. Geometric Depreciation: Geometric Decay rem ================================================================ rem ------------------------------------ rem Rate of Return on Capital rem ------------------------------------ range match file[roe14] key[year] match file[rintavg] key[year] rem National Sample Average Embedded Interest Rate on Long Term Debt set rintavg = rintavg2 range range if[year==1993] set rintavg = rintavg[+1] rem Rate of Return range range if[year>1992] set return = roe13/2 + rintavg/2 rem Create a variable that contains the return for a single year for all observations range array years = (1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014) range foreach (yr;$years) { range set r${yr} = 0 range if[year==${yr}] set r${yr} = return range aggregate var[r${yr}] to [ret${yr}] by[pegid] sum } rem ------------------------------------------------ rem Assign Regional Construction Cost Indexes rem ------------------------------------------------ rem import alternate TWA based on know capacity additions (not levelized) range match file[twacaplg2] key[pegid year] var[twacaplg] rem Levelize capital price index range match file[rsmavg08] key[pegid] var[rsmavg] set wkaht = hwel22 set wkaht08 = wkaht set wkaht64 = wkaht save file[hw08] var[wkaht08 pegid] if[year==2008] match file[hw08] var[wkaht08 ] key[pegid] sys del hw08.sav rem normalize values to 1.00 in 2008 and levelize set wkah = (wkaht/wkaht08)*rsmavg rem levelize alternate TWA range if[year==1964&samp==1] set twacap = twacaplg*(wkah/wkaht64) rem ------------------------------------------------------------------------------------------------ rem Geometric Decay Method rem 1. Calculate the average price at which 1964 net plant was accumulated rem 2. Estimate the capital quantity in 1964 rem 3. Assign economic depreciation rates which are to be applied geometrically rem 4. Create a timeseries of capital quantity using a perpetual inventory method rem 5. Create smoothed and unsmoothed versions of price and cost of capital rem ------------------------------------------------------------------------------------------------ rem ------------------------------------------ rem Distribution and General Plant rem ------------------------------------------ rem Calculate the average price at which net plant was aquired by taking a 49 year historical average using triangular weights range range if[samp==1] range if[year<1965] set wkahi = wkah*(49-(1964-year))/1225 aggregate var[wkahi] to [denomhgd] by[pegid] if[wkahi>0] sum rem Estimate Capital Quantity in the "Benchmark Year" (1964) range range if[year==1964] range if[samp==1] set phydnp = phyd64 - dhyd64 rem choose between standard and alternate TWA rem set xcaphyde = phydnp/denomhgd set xcaphyde = phydnp/twacap rem rem Economic Depreciation Rates rem rem Rate based on weighted average of economic depreciation rates by type of asset rem using BEA depreciation rate data rem range rem Based on OPG Depreciation work: 44/56 STR/EQ 100/52 life (using CMP aggregation method) set dhyd = 0.0263 rem rem Create EOY Capital Stocks Using a Perpetual Inventory Equation rem array years = (1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 \ 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014) foreach (i;$years){ range range if[year==${i}] set xcaphyde = (1-dhyd)*xcaphyde[-1] + phyda/wkah } range range if[year>1964] rem Calculate real rates of return set realrh = (return-(wkah-wkah[-1])/wkah[-1]) rem Distribution Non-Tax Capital Cost set xkhgd = xcaphyde[-1] set wkohgd = return*wkah[-1]+dhyd*wkah-(wkah-wkah[-1]) set wkohsmgd = dhyd*wkah + wkah[-1]*(realrh + realrh[-1] + realrh[-2]) / 3 set ckodgh = xkhgd*wkohgd set ckohsmgd = xkhgd*wkohsmgd rem =============================================================================== rem Further Cost Calculations rem 1. Create method to allocate general costs rem 2. Calculate the labor portion of O&M cost by cost category rem 3. Calculate the materials and services portion of O&M cost by cost category rem 4. Calculate labor and non-labor O&M for Distribution and related functions rem 5. Add taxes (if desired) to capital cost rem 6. Choose among the previously calculate capital cost or use a simplified method rem 7. Calculate O&M and total cost for Distribution and related functions rem =============================================================================== rem ---------------------------------------------- rem Capital Cost rem ---------------------------------------------- rem --------------------------------------------------------------- rem Create Tax Allocator based on Gross Plant rem --------------------------------------------------------------- range range if[year>1994&samp==1] set staxh = phydtote / ptote rem Calculate Total Taxes set taxtot = (ctaxothe + ctxfedie + ctxstaie + cagefrc) rem Allocate Taxes by Function using gross plant set taxh = staxh*taxtot rem Rename capital cost variables range range if[year>1990] set wkoh = wkohsmgd set xkhh = xkhgd set ckh = wkoh*xkhh + taxh rem ------------------------------------------------- rem Calculate O&M and Total Cost rem ------------------------------------------------- range range if[samp==1&year>1994] set comh = (chyd-chydh2o) set ch = comh + ckh rem =================================================== rem Input Prices (w) rem =================================================== range match file[eci2014] key[year] match file[ecimap3.sav] key[pegid] var[ecireg] rem ----------------------------------------------------- rem Assign Regional Labor (wl) Price Indexes rem for Salaries and Wages and Total Compensation Calculated Using BLS Data rem ----------------------------------------------------- range range if[ecireg==1] set wls = eciswne set wlc = ecitcne range range if[ecireg==2] set wls = eciswso set wlc = ecitcso range range if[ecireg==3] set wls = eciswmw set wlc = ecitcmw range range if[ecireg==4] set wls = eciswwe set wlc = ecitcwe range range if[samp==1] rem Salary and Wage Price Index set wlsh = wls rem Total Compensation Index set wlch = wlc rem ----------------------------------------------------- rem Materials & Services (wm) rem ----------------------------------------------------- rem ------------------------------------------------------ rem Custom Material and Service Price Indexes rem Using BLS Producer Price Indexes rem Please see supporting calculations: "Materials and Services Price Index.xls" rem ------------------------------------------------------ range range if[year>1994] set wmh = gdppi rem ----------------------------------------------------- rem O&M Price Index rem ----------------------------------------------------- range range if[samp==1&year>1994] set pctlab = sprde / (cprd-cfosful-cnucful-copgful-chydh2o) set pcthyd = (ghyc+ghyp)/gnet rem print var[pegid g*] rem range if[pcthyd>0.1] rem print var[pegid pctlab pcthyd] set dwomh = 0.3679*log(wlsh/wlsh[-1]) + (1-0.3679)*log(wmh/wmh[-1]) range range if[year==1995] set womh = 100 array years = (1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014) foreach (i;$years){ range range if[year==${i}] set womh = womh[-1]*exp(dwomh) } rem --------------------------------------------------------- rem Capital rem --------------------------------------------------------- range range if[samp==1&year>1994] rem Non-tax service price set wkh1 = wkoh rem Capital price including taxes set wkh2 = ckh / xkhh rem Capital service price set wkh = wkh2 rem =================================================== rem Input Quantity Subindexes rem =================================================== range range if[samp==1] set xoh = comh / womh rem =========================================================== rem Productivity Trends and Other Trend Index Calculations rem =========================================================== rem --------------------------------------------------- rem Shares of Total Cost rem --------------------------------------------------- range range if[samp==1] range if[year>1994] rem Multifactor with 4 categories set soh = comh/ch set skhh = ckh/ch set skh = skhh rem Shares of Capital Cost set skkh = 1 rem --------------------------------------------------- rem Index Growth Rates rem --------------------------------------------------- rem ------------------------------------ rem Output Quantity Index Growth (y) rem ------------------------------------ rem Capacity set ych = caphyd set dych = log(ych/ych[-1]) rem MWh Generated set yvh = ghyc + ghyp set yvh2 = ghyc set dyvh = log(yvh/yvh[-1]) set dyvh2 = log(yvh2/yvh2[-1]) set dy = dych rem --------------------------------- rem Cost (c, com) rem --------------------------------- set dch = log(ch/ch[-1]) set dcomh = log(comh/comh[-1]) rem ---------------------------------------- rem Input Quantity Indexes (x) rem ---------------------------------------- rem Input Quantity Subindex Trends set dxoh = log(xoh/xoh[-1]) set dxkhh = log(xkhh/xkhh[-1]) set dxoh = log(xoh/xoh[-1]) set dxh = 0.5*(soh+soh[-1])*dxoh + 0.5*(skh+skh[-1])*dxkhh set dxkh = dxkhh rem ------------------------- rem Productivity (tfp, pfp) rem ------------------------- set dpfpo = dy - dxoh set dtfph = dy - dxh set dpfpoh = dy - dxoh set dpfpkh = dy- dxkh rem 1974 calculations range range if[samp==1] range if[year==1974] set ych = caphyd set yvh = ghyc set comh = chyd - chydh2o set womh = 100*(25.760/75.393) set xoh = comh / womh rem ------------------------------------ rem 1974-1995 trends rem ------------------------------------ range range if[samp==1] range if[year==1995] set dych = log( ych / ych[-21] ) / 21 set dyvh = log( yvh / yvh[-21] ) / 21 set dy = dych set dxoh = log( xoh / xoh[-21] ) / 21 set dxkh = log( xkhh / xkhgd[-21] ) / 21 set dxh = soh*dxoh + (1-soh)*dxkh set dpfpoh = dy - dxoh set dpfpkh = dy - dxkh set dtfph = soh*dpfpoh + (1-soh)*dpfpkh rem ----------------------------------- rem Price levels for econometric work rem ------------------------------------ range match file[wage08b.sav] key[pegid] var[wage08] range range if[year==2008&samp==1] aggregate var[wage08] to[wage08m] by[year] if[year==2008&samp==1] mean rem create the 2008 price level equal to a weighted average of the mean scaled price levels for each subindex rem Assume 25% of the non-labor cost is labor related range range if[year==2008] set womlvl = 0.3679*(wage08/wage08m) + (0.75*(1-0.3679)*1.00 + 0.25*(1-0.3679)*(wage08/wage08m)) range set dwomt = dwomh rem Extend the 2008 level forward using trend array omyrsf = ( 2009 2010 2011 2012 2013 2014) array omyrsb = (2007 2006 2005 2004 2003 2002 2001 2000 1999 1998 1997 1996 1995) foreach(yr;$omyrsf) { range range if[year==${yr}] set womlvl = womlvl[-1]*exp(dwomt) } rem Extend the 2008 level backwards using trend foreach(yr;$omyrsb) { range range if[year==${yr}] set womlvl = womlvl[+1]/exp(dwomt[+1]) } range range if[samp==1] set womhl = womlvl set wkhl = wkh echo ***************************************************************** echo Average Annual Growth echo ***************************************************************** rem ------------------------------------------------- rem Calculate sample average growth by year rem ------------------------------------------------- range range if[year>1994] range if[samp==1] aggregate var[dtfph dy dxh dpfpoh dpfpkh dxoh dxkh dyvh] \ to[dtfpha dya dxha dpfpoha dpfpkha dxoha dxkha dyvha] by[year] if[year>1994&samp==1] mean range if[pegid==2] echo ***************************************************************** echo Sample Average Growth Rates 1996-2014 echo ***************************************************************** echo ************* Index Results ********************* print var[year dtfpha dya dxha dpfpoha dpfpkha ] echo *********** Input Quantity Subindexes *********** print var[year dxha dxoha dxkha dyvha] echo -------------- Trends ---------------------- rem 1995-2014 range range if[year>1994] aggregate var[dtfpha dya dxha dpfpoha dpfpkha ] to[dtfphm dym dxhm dpfpohm dpfpkhm ] if[samp==1&year>1994] by[pegid] mean range if[year==2014&pegid==2] echo ------------- 1996-2014 (19 Years) ----------------- print var[dtfphm dym dxhm dpfpohm dpfpkhm] rem 2002-2014 range range if[year>2002] aggregate var[dtfpha dya dxha dpfpoha dpfpkha ] to[dtfphm dym dxhm dpfpohm dpfpkhm ] if[samp==1&year>2002] by[pegid] mean range if[year==2014&pegid==2] echo ------------- 2003-2014 (11 Years) ----------------- print var[dtfphm dym dxhm dpfpohm dpfpkhm] rem 1974-1995 (Average Annual Growth Rate from 1974-1995 is stored in the 1995 observation) range range if[year==1995] aggregate var[dtfpha dya dxha dpfpoha dpfpkha ] to[dtfphm dym dxhm dpfpohm dpfpkhm ] if[samp==1&year==1995] by[pegid] mean range if[year==1995&pegid==2] echo ------------- 1975-1995 (21 Years) ----------------- print var[dtfphm dym dxhm dpfpohm dpfpkhm] rem Company by Company Trends range range if[samp==1] aggregate var[dtfph dy dyvh dych dxh dxoh dxkh] to[dtfpi96 dyi96 dyvi96 dyci96 dxhi96 dxohi96 dxkhi96] by[pegid] if[year>1995] mean echo ------- 1996-2014 Trends by Company -------------- range if[year==2014] print var[pegid dtfpi96 dyi96] print var[pegid dyi96 dxhi96] print var[pegid dxohi96 dxkhi96] echo ------------------------------------------------------ rem -------------------------- rem Weighted Average TFP 1996-2014 rem -------------------------- range range if[samp==1] aggregate var[ch] to[chs] by[samp year] if[year==2014] sum set pctcost = ch / chs set wtxtfp = (ch*dtfpi96)/chs set wtxy = (ch*dyi96)/chs set wtyv = (ch*dyvi96)/chs set wtyv = (ch*dyci96)/chs set wtxh = (ch*dxhi96)/chs set wtxoh = (ch*dxohi96)/chs set wtxkh = (ch*dxkhi96)/chs rem Sum the components of the weighted average to get weighted average growth rates by year aggregate var[wtxtfp wtxy wtyv wtxh wtxoh wtxkh] to[dtfpw dyw dyvw dxw dxow dxkw] by[year] sum range if[pegid==2&year==2014] echo 96-14 trend print var[dtfpw dyw dyvw dxw dxow dxkw] rem -------------------------- rem Weighted Average TFP 2003-2014 rem -------------------------- range range if[samp==1] aggregate var[dtfph dy dyvh dych dxh dxoh dxkh] to[dtfpi2 dyi2 dyvi2 dyci2 dxhi2 dxohi2 dxkhi2] by[pegid] if[year>2002] mean range range if[samp==1] aggregate var[ch] to[chs] by[samp year] if[year==2014] sum set pctcost = ch / chs set wtxtfp = (ch*dtfpi2)/chs set wtxy = (ch*dyi2)/chs set wtyv = (ch*dyvi2)/chs set wtyv = (ch*dyci2)/chs set wtxh = (ch*dxhi2)/chs set wtxoh = (ch*dxohi2)/chs set wtxkh = (ch*dxkhi2)/chs rem Sum the components of the weighted average to get weighted average growth rates by year aggregate var[wtxtfp wtxy wtyv wtxh wtxoh wtxkh] to[dtfpw dyw dyvw dxw dxow dxkw] by[year] sum range if[pegid==2&year==2014] echo 2003-2014 trend print var[dtfpw dyw dyvw dxw dxow dxkw] rem use Tornqvist Weights range aggregate var[ch] to[chyr] by[year] if[samp==1] sum range range if[year>1994] set pctcost = ch / chyr set wtxtfp = 0.5*(pctcost+pctcost[-1])*dtfph set wtxy = 0.5*(pctcost+pctcost[-1])*dy set wtyv = 0.5*(pctcost+pctcost[-1])*dyvh set wtyc = 0.5*(pctcost+pctcost[-1])*dych set wtxh = 0.5*(pctcost+pctcost[-1])*dxh set wtxoh = 0.5*(pctcost+pctcost[-1])*dxoh set wtxkh = 0.5*(pctcost+pctcost[-1])*dxkh rem sum the products to get the weighted average growth by year aggregate var[wtxtfp wtxy wtyv wtyc wtxh wtxoh wtxkh] to[dtfpw dyw dyvw dycw dxw dxow dxkw] by[year] sum range if[pegid==2] print var[year dtfpw dyw dyvw dycw dxw dxow dxkw] range range if[pegid==2] aggregate var[dtfpw dyw dyvw dycw dxw dxow dxkw] to[dtfpwa dywa dyvwa dycwa dxwa dxowa dxkwa] by[pegid] if[year>1995] mean range if[year==2014] print var[year dtfpwa dywa dyvwa dycwa dxwa dxowa dxkwa] rem 1975-1995 averages range range if[year==1995] set pctcost = ch / chyr set wtxtfp = pctcost*dtfph set wtxy = pctcost*dy set wtyv = pctcost*dyvh set wtyc = pctcost*dych set wtxh = pctcost*dxh set wtxoh = pctcost*dxoh set wtxkh = pctcost*dxkh rem sum the products to get the weighted average growth by year aggregate var[wtxtfp wtxy wtyv wtyc wtxh wtxoh wtxkh] to[dtfpw dyw dyvw dycw dxw dxow dxkw] by[year] sum range if[pegid==2] print var[year dtfpw dyw dyvw dycw dxw dxow dxkw] range range if[pegid==2] aggregate var[dtfpw dyw dyvw dycw dxw dxow dxkw] to[dtfpwa dywa dyvwa dycwa dxwa dxowa dxkwa] by[pegid] if[year==1995] mean range if[year==1995] print var[year dtfpwa dywa dyvwa dycwa dxwa dxowa dxkwa] quit