sum() total() pc() rowtotal() 下为stata11 Manual中的例子,从上里来看,sum()和total()两个函数是不同的,其中sum()为按照下标动态累加。而total()是求总和。但应该 注意的是这里是stata's sum() VS egen's total(),如果在egen下使用sum(),作用与total()相同。 Distinguish carefully between Stata’s sum()function and egen’s total()function. Stata’s sum()function creates the running sum, whereas egen’s total() function creates a constant equal to the overall sum. For example: clear set obs 5 gen a=_n gen sum1=sum(a) egen sum2=total(a) list 执行结果如下: . do "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\STD00000000.tmp" . clear . set obs 5 obs was 0, now 5 . gen a=_n . gen sum1=sum(a) . egen sum2=total(a) end of do-file . list +-----------------+ | a sum1 sum2 | |-----------------| 1. | 1 1 15 | 2. | 2 3 15 | 3. | 3 6 15 | 4. | 4 10 15 | 5. | 5 15 15 | +-----------------+ 如果将上述例子稍微修改,将第四行代码中gen改为egen如下: clear set obs 5 gen a=_n egen sum1=sum(a) egen sum2=total(a) list 执行结果如下: . clear . set obs 5 obs was 0, now 5 . gen a=_n . egen sum1=sum(a) . egen sum2=total(a) end of do-file . list +-----------------+ | a sum1 sum2 | |-----------------| 1. | 1 15 15 | 2. | 2 15 15 | 3. | 3 15 15 | 4. | 4 15 15 | 5. | 5 15 15 | +-----------------+ sum()、total()两个命令的应用: 请问如何用stata命令求在下列四组每个公司在各自行业中的销售额比率?如行业1,先求行业内四个公司的销售总额,然后求A1,A2...各自占行业的份额。 公司 Sales 行业 A1 27.72 1 A2 26.37 1 A3 24.79 1 A4 18.69 1 B1 17.48 2 B2 17.04 2 B3 10.87 2 B4 6.68 2 C1 9.06 3 C2 6.8 3 C3 8.85 3 C4 9.43 3 D1 11.48 4 D2 13.96 4 D3 14.19 4 D4 17.93 4 使用total()或者sum()函数就可以完成这个任务,为避免中文无法识别,将行业变量命名为industry 代码如下: by industry ,sort : egen sale_s=total(Sales) gen ratio=Sales/sale_s 当然,stata中还有一个一直的求所占比率的函数pc(),这个也是egen命令的fnc之一。 改进的命令为: by industry, sort: egen ratio=pc(Sales),prop 关于pc() pc( exp ) (allows by varlist ) returens exp (within varlist) scaled to be a percentage of the total, between 0 and 100. The prop option returns exp scaled to be a proption of the total, between 0 and 1. 此为stata11中egen函数下pc()的说明,从内容来看,pc()这一function可以返回变量某一取值占总和的比重,加上prop这一option之后,可将百分数改为0到1之间的小数。而且,此function可与by连用,从而功能更加强大。 关于rowtotal(): generate’s sum()function creates the vertical, running sum of its argument, whereas egen’stotal()function creates a constant equal to the overall sum. egen’s rowtotal()function, however,creates the horizontal sum of its arguments. They all treat missing as zero. However, if the missingoption is specified with total()or rowtotal(), then newvar will contain missing valuesif allvalues of exp or varlist are missing. 从这段话来看,sum()函数做的是纵向合并,total()函数得到的是最终的和,二rowtotal()函数则是横向求和。三种函数都把缺省值视为数值0。 例子: . webuse egenxmpl4,clear . egen hsum=rowtotal(a b c) . generate vsum=sum(hsum) . egen sum=total(hsum) . list +----------------------------------+ | a b c hsum vsum sum | |----------------------------------| 1. | . 2 3 5 5 63 | 2. | 4 . 6 10 15 63 | 3. | 7 8 . 15 30 63 | 4. | 10 11 12 33 63 63 | +----------------------------------+ end of do-file 这个例子生动的展示了sum() total() rowtotal() 之间的区别。
Regression versus correlation All readers will be aware of the notion and definition of correlation. The correlation between two variables measures the degree of linear association between them. If it is stated that y and x are correlated, it means that y and x are being treated in a completely symmetrical way. Thus, it is not implied that changes in x cause changes in y, or indeed that changes in y cause changes in x. Rather, it is simply stated that there is evidence for a linear relationship between the two variables, and that movements in the two are on average related to an extent given by the correlation coefficient. In regression, the dependent variable (y) and the independent variable(s) (xs) are treated very differently. The y variable is assumed to be random or ‘stochastic’ in some way, i.e. to have a probability distribution. The x variables are, however, assumed to have fixed (‘non-stochastic’) values in repeated samples.1 Regression as a tool is more flexible and more powerful than correlation.
Cross-sectional data Cross-sectional data are data on one or more variables collected at a single point in time. For example, the data might be on: ● A poll of usage of Internet stockbroking services ● A cross-section of stock returns on the New York Stock Exchange (NYSE) ● A sample of bond credit ratings for UK banks. Problems that could be tackled using cross-sectional data: ● The relationship between company size and the return to investing in its shares ● The relationship between a country’s GDP level and the probability that the government will default on its sovereign debt.
The value of econometrics (1) Testing whether financial markets are weak-form informationally efficient (2) Testing whether the Capital Asset Pricing Model (CAPM) or Arbitrage Pricing Theory (APT) represent superior models for the determination of returns on risky assets (3) Measuring and forecasting the volatility of bond returns (4) Explaining the determinants of bond credit ratings used by the ratings agencies (5) Modelling long-term relationships between prices and exchange rates (6) Determining the optimal hedge ratio for a spot position in oil (7) Testing technical trading rules to determine which makes the most money (8) Testing the hypothesis that earnings or dividend announcements have no effect on stock prices (9) Testing whether spot or futures markets react more rapidly to news (10) Forecasting the correlation between the stock indices of two countries.
【2015新书】A Comparative Analysis of European Time Transfers between Generations and Genders https://bbs.pinggu.org/thread-3592687-1-1.html 声明: 本资源仅供学术研究参考之用,发布者不负任何法律责任,敬请下载者支持购买正版。 提倡免费分享! 我发全部免费的,分文不收 来看看 ... 你也可关注我 https://bbs.pinggu.org/z_guanzhu.php?action=listattentionfuid=3727866
Is This Why Gold Is Spiking Submitted by Tyler Durden on 08/14/2013 10:56 -0400 That JPMorgan has been scrambling day after day in the past week to meet gold delivery requests directed to its vault located deep under 1 CMP is no secret, at least not to our frequent readers. This peaked on Monday when, courtesy of a color-coded Comex scheme, we showed how panicked the lateral moves between various Comex gold vaults had become to preserve the illusion of physical availability. However, as yesterday's Comex report showed , instead of tapering, JPM was just slammed with yet another 70K delivery (registered to eligible warrant detachment), which will likely appear on either today's or tomorrow's settlement. And since the other gold vaults appear to have no more freely transferrable gold to hand over to JPM as everyone is now scrutinizing their every move under a microscope, JPM may no longer have the option of ignoring the mess its vault is in. Which means it has one option: to start buying the metal in the open market. And sure enough, breaking from the "standard" of the past 8 months, in which JPM was drowning in Issues, for both House and Customer accounts, the firm's House accounts just saw the largest Stop (i.e. taking delivery) since December of 2012, amounting to over 210K oz. Has JPM, flooded with demands for physical, finally thrown in the towel, and seeing that the deluge in delivery requests is "untapering", had no choice but to turn to the one place it has left to replenish its stocks: the market? Still, here is the big picture - until the 2103 August Stop, the balance for JPM House accounts was: Issues: 15,293 Stops: 636 And Clients: Issues: 17,458 Stops: 1,444 In other words, there is a ways to go. Source: CME Average: 4.78125 Your rating: None Average: 4.8 ( 32 votes) !-- -- Tweet !-- - advertisements - .AR_2 .ob_empty {display: none;} .AR_2 .rec-link {color: #565656;text-decoration: none;font-size: 12px;} .AR_2 .rec-link:hover {color: #565656;text-decoration: underline;font-size: 12px;} .AR_2 {float: left;width:50%} .AR_2 li {list-style: none outside none !important;font-size: 10px;padding-bottom: 10px;line-height: 13px;margin:0;} .AR_2 .ob_org_header {color: #000000;text-decoration:bold; margin-left: 0px; font-size:14px;line-height:35px;} .AR_3 .rec-link {color: #565656;text-decoration: none;font-size: 12px;} .AR_3 .rec-link:hover {color: #565656;text-decoration: underline;font-size: 12px;} .AR_3 .rec-src-link {font-size: 12px;} .AR_3 li {padding-bottom: 10px;list-style: none outside none !important;font-size: 10px;line-height: 13px;margin:0;} .AR_3 .ob_dual_left, .AR_3 .ob_dual_right {float: left;padding-bottom: 0;padding-left: 2%;padding-top: 0;} .AR_3 .ob_org_header {color: #000000; text-decoration:bold; margin-left: 0px; font-size:14px;line-height:35px;} .AR_3 .ob_ads_header {color: #000000; text-decoration:bold; margin-left: 0px; font-size:14px;line-height:35px;} -- - advertisements - Login or register to post comments 30814 reads Printer-friendly version Send to friend Similar Articles You Might Enjoy: Goldman's Head Gold Trader On The Recoupling Between Gold (Which Is Up 14% YTD) And Money, And Why This Is 2008 All Over Again Is This Why Gold Is Outperforming? Is This Why Gold Is Selling Off? Is This Why Gold Dumped And Stocks Pumped Today? Is This Why Gold (And Europe) Is Underperforming US Stocks (For Now)?
Visualizing The Impotence Of Bernanke's Wealth Transmission Channel Submitted by Tyler Durden on 11/11/2012 13:39 -0500 We have discussed the apparent (though anecdotal) divergence between refinancing rates and interest rates a number of times. Furthermore, we have exclaimed at the significant drop in refi rates since QE3 (following the initial spike) noting the unintended consequence that US households are increasingly realizing that rates will never be allowed to rise and so every rate rise is not a signal to rush into refinancing but instead a signal to pause for lower rates . The chart below is somewhat surprising in its clarity as Goldman Sachs note that despite record low mortgage rates, borrowers are refinancing at a rate of just 20-30% per year - far lower than prepayment speeds we would expect. The great majority of 'in the money' mortgages are not being refinanced and while we suggest this is the unintended Bernanke conditioning, Goldman also opines that industry capacity and underwriting standards on the supply side; and consumer awareness and household behavior on the demand side. Via Goldman Sachs: I n normal times, borrowers with high credit quality would have refinanced as soon as mortgage interest rates declined. The chart above shows that this is largely the case before 2009 for Fannie Mae 30-year fixed rate mortgages. The percent of loans that are “in-the-money” for refinancing (defined as the borrower’s mortgage rate being at least 100bps above the market rate) is highly correlated with the subsequent prepayment speeds. However, this relationship broke down in 2008. Nearly 80% of outstanding Fannie Mae 30-year fixed rate mortgages are currently in-the-money for refinancing, but the actual prepayment speeds are much lower than what the historical experience would predict. Why aren’t more borrowers, especially those with stellar credit quality, taking advantage of today’s low mortgage interest rates and refinancing? On the supply side , one obvious suspect is the fact that industry origination capacity is constrained. The capacity constraints are a symptom of both substantial industry contraction as well as uncertainties related to reps and warranties exposure, the future of the regulatory landscape, and the outlook for housing and economy. Nevertheless, capacity constraints imply tight lending standards and less refinancing originations. This is consistent with our finding that borrowers with the highest FICO and lowest LTV are prepaying relatively faster today. Due to the tightness of industry constraints, today’s mortgage lenders are doing less advertising, marketing, and outreaching to encourage refinancing. This is consistent with our finding that the baseline prepayment speeds of all mortgages are lower than it was in 2003. On the demand side , we are harder pressed to think of reasons why borrowers, especially those with good credit and sufficient home equity, are not refinancing. One possibility is that many borrowers are not aware of how much the market rate has declined . Another possibility is that borrowers may think that lending standards are so tight today that they would be denied of refinancing, or that the process would be too much an ordeal. Lastly, household behavior such as inertia and procrastination that have been documented in the academic literature may be at play in the mortgage market, especially with industry solicitations having dropped off so substantially . It would seem - once again - that the so-called raison d'etre for QE3 is entirely broken, whether easing to ZIRP of LSAP, Bernanke's wealth-building transmission channel via housing is entirely broken ... and critically it is the banks once again that both benefit from the front-running capability as well as becoming the plug in the pipeline... Average: 4.375 Your rating: None Average: 4.4 ( 8 votes) Tweet Login or register to post comments 7434 reads Printer-friendly version Send to friend Similar Articles You Might Enjoy: QA with Alan Boyce: Freddie Mac and Inverse Floaters Pimco Borrows A Record $88 Billion To Bet On Fed's Upcoming MBS Monetization Obama Bluffs on ReFi? Mortgage Refinancing And The Fed's Perverse Incentives Fed Unintended Consequence #267435: Homeowners Front-Running QE By Not Refinancing
US Treasury Admits It Conducted A Circular Ponzi Scheme For Years Submitted by Tyler Durden on 08/17/2012 09:29 -0400 Nationalization Tim Geithner While one may wonder about the implications of the just announced "accelerated windown" of the GSEs, predicated in no small part by the surge in animosity between Tim Geithner and the FHFA's Ed DeMarco, there is one aspect of the announcement that is completely and utterly unambigious: as part of its justification to demand faster liquidation of Fannie and Freddie's "investment portfolio" Tim Geithner gave the following argument : This will help achieve several important objectives, including... Ending the circular practice of the Treasury advancing funds to the GSEs simply to pay dividends back to Treasury In other words not some fringe blog, not some "partisan" media outlet, not some morally conflicted whistleblowing former employee seeking immunity, but the US Trasury itself just admitted it had been engaged in circular check kiting scheme, which essentially has all the components of a Ponzi scheme in it, ever since the nationalization (about which there is no now doubt and which means the GSE's $6 trillion in debt is now fully on the Treasury's balance sheet) of Fannie and Freddie in 2008. Transfer one more conspiracy theory into the conspiracy fact bin. Average: 4.875 Your rating: None Average: 4.9 ( 24 votes) Tweet Login or register to post comments 8503 reads Printer-friendly version Send to friend Similar Articles You Might Enjoy: Crony Socialism Strikes Back: Geithner Retaliates Against DeMarco; Accelerates Wind Down Of GSE Treasury Backing Geithner To DeMarco: "I Do Not Believe Is The Best Decision For The Country" Bank Of America Has Lost Money Trading On Only Three Days In 2012 Guest Post: TBTF Banks Laughing All The Way Home Thanks To HARP Presenting The Shocking Source Of US Treasury Demand In The Past Year
Is Paul Ryan’s Budget ‘Un-Christian’? TIME MAGAZINE (August 14, 2012) http://ideas.time.com/2012/08/14/why-paul-ryans-budget-unchristian/ Americans often tell pollsters they yearn for a return to the Christian principles on which the U.S. was founded. If so, they should take a closer look at the Romney-Ryan ticket. Jesus’s teachings regarding wealth are nowhere to be found in Paul Ryan’s budget proposals. As near as we can tell, Jesus would advocate a tax rate somewhere between 50% (in the vein of “if you have two coats, give one to the man who has none”) and 100% (if you want to get into heaven, be poor). Mostly, he suggested giving all your money up for the benefit of others. And Jesus made no distinction between the deserving and undeserving poor; his love and generosity applied to all. What about Paul Ryan? Ryan hasn’t released his tax returns yet, so we don’t know what rate he pays. But under his budget plan, according to a recent analysis in the Atlantic, Mitt Romney would pay only 0.8% of his income in federal taxes. That’s right: in Ryan’s budget scenario, one of our wealthiest citizens would pay less than one percent of his income in taxes, or less than $200,000 from a taxable income of almost $22 million.When it comes to paying taxes, Paul Ryan is Mitt’s wing man. …… Note:it is so weird to see this article. Anyway I don’t know whether it is right or not, we should check it! it is from the time magazine.