I pinched you all and I got such support. Mel admitted and said, okay, you can do panel two, but I'm watching you. So he's going to sit right over there. I'll resign. Don't mess with tags. Oh yes, I'm sorry, thank you. So in true bubblehead fashion, when we leave, when you leave today, please leave your name tags and we'll collect those and do it again. Just a holder. Okay, not your name, just a holder. Okay, so this is the second panel and final panel for the day and I'd like to do some introductions. Starting over on the far left is Christine Vins. She's Morningstar Director of Personal Finance in the senior columnist from Morningstar.com. Please welcome Christine Vins. Next to her, we have Alan Roth, who's the founder of Wealth Object. He's an author and art columnist, AARP columnist. Please welcome Alan Roth. Next to Alan, we have Mike Piper. He's a Missouri licensed CPA and the author of the blog of Mobius Investor. He's also authored a number of very successful digital books. Please welcome Mike Piper. And last but not least, founder of the low-cost investment firm Portfolio Solutions, author of six investment-related books, four of that columnist and a Wall Street Journal expert contributor. Please welcome Rick Perry. So there was a question about asset allocation that was for the first panel and there are some people on this panel that would probably like to start with a response to that question as well. So I'll open up the question for the panel on the question that came up about asset allocation. Which one? Oh, which one was it? You guys tell me. Rebalancing. Sorry, rebalancing, yes. The question was how often should you rebalance? Well, for a should you rebalance, how often should you rebalance? Probably annually, bands, and so forth. And then the panel would have to comment. So we'll start with the left side and work our way down. I think less is more when it comes to rebalancing. But I like the idea of Vanguard has done some nice research on this topic too where you just do that annual check-in and I think once or twice a year is plenty. See how much your portfolio has diverged from your targets. 5 percentage points seems reasonable. Vanguard's research generally supports the rebalancing at 5 percentage point divergences. I think if you want to be hands off or if transaction or tax costs are a big consideration or if a lot of your portfolio is taxable, that may be leaned toward even higher rebalancing thresholds, maybe 10 percentage points. I am also a big fan of paying attention to the sub-rebalancing that you can do. So at various points in time, even though maybe your equity allocation is 5 percentage points above your target, you've got specific holdings that have really been the drivers of that strong performance. So starting your rebalancing there. I also tend to find rebalancing really effective when I sync it up. I help my mom with her RMDs. And so syncing up the rebalancing process with that RMD process, we're always trimming whatever has performed best for her. That's where we go for her RMDs. So just a couple of thoughts on that front, but I guess I generally agree that less is more. I used to think that picking an asset allocation was the most important decision and I've changed my mind. It's committing to stick to an asset allocation. That is even more important because if you look at the mining star data over the last 10 years, you'll just see that the average investor return was 2.49% below the average fund return. So picking a band, and generally I think 5 percentage points is really good, and sticking to it, actually over the long run, it's a risk management strategy, but it's also a market timing strategy that then happens to work. So it's a long run, you know, selling what's performed best and buying what's performed the worst. Contrary and might include. Rebalancing is definitely a topic about which I do not have strong feelings. If you want some rebalance every day because you're using a target retirement fund, great. If you want to rebalance once a year because that's easy, it's easy to remember to do it on your birthday or half-birthday or whatever, great. Just like Alan said, just stick to a plan, whatever plan it is that you come up with. Hey, I have some thoughts. By the way, I'm sitting in Jack Vogel's seat. Still feeling. This did a lot of work on rebalancing, crunched a bunch of numbers. It's overrated. I think that it's oversold, and I'm not saying this because I'm sitting in Jack's seat, but I think he's had the same thing. I think that as an advisor, and I am an advisor that it's used for a lot of marketing by the advisors, I think it actually leads to higher taxes because you're doing this rebalancing when you really don't need it. So my thinking on rebalancing as I continue to crunch these numbers is shifting towards pristine, less is more, idea. I think that you can do this mostly with cash flow, either a distribution from a required minimum distribution or if you're adding money on a regular basis, you can use cash to rebalance. Dividends in interest as it comes into your portfolio if you're taking cash. You can rebalance using that way. And I think that's almost enough. If there is a big shift in the market, 20% down, 20% up, and your asset allocation is off by a significant amount, and you want to do a rebalancing, that's fine, and the taxable account, of course you want to take long-term capital gains or if the market's down, make sure you're not taking any gains, but do it in conjunction with tax loss harvesting. But I will also say that in my research that if you have a portfolio that's high in equity, 70, 80%, if you do rebalancing maybe once every 10 years, that's probably enough. So those are my new and improved thoughts on rebalancing. I think that the cash flow side of it is the most important side. And having a plan, as Alan said, is important as well. But I just think that the over-rebalancing thing has been over-hyped by the advisory community because that's how we get paid after we create a portfolio for you. I didn't really say that. I think it's true. Rick, I have a follow-up question for you. If I'm not rebalancing or doing it very frequently and sort of normal equity-bond cash relationships hold, my equity piece is going to be going up and up and up in that front. It's contrary to what most people think about when they're thinking about sort of a polite path. So how do you get those things together? Okay, Wade isn't here, but Wade's new philosophy on an asset allocation and retirement. Did you start out with a relatively low equity exposure somewhere between 20 and 40 percent? And I'm actually just writing, finishing up a paper that says around 30 percent, so I ended up being right in the middle after talking with Wade while I was here. And then, for the rest of your life, you don't rebalance at all. You take the cash flow from the stocks, you take the cash flow from the bonds, and you let the equity exposure increase because that's a better match to your future liabilities down the road. So it's an interesting concept. Wade and Michael Kitzes have developed this idea. So, in fact... I'm talking about the accumulation years, really, at some point. Even so, say I want to get my equity piece down to 20 percent of my portfolio, that has to happen at some point, and if I'm not rebalancing during the accumulation years, how's that working? Well, again, during the accumulation years, I wrote an article one time called The Flight Path Approach to Asset Allocation, where it basically says younger people don't have a lot of experience in the market. We had a conversation with Mike yesterday or the day before, and yesterday actually talking about the fact that younger people, a lot of them are living with a stare to invest in stocks, so should you just go running in with the 90 percent allocation and say, oh, you're young. You should have 100 percent stocks and 90 percent stocks. I don't think that's the right idea for young people. I think that the starting amount low in stocks and then letting them gradually build as they go through a few bear markets might be actually a better idea. So then it gets the question of rebalancing. If you want to build that equity side over time as they get used to bear markets, maybe you don't need to rebalance. So all I'm saying is that this whole idea of rebalancing, I believe, needs to be rethought. It's nice. It sounds good. And I'll also tell you that the volatility of a 60-40-40 portfolio is much higher than the volatility of a 30-70 portfolio. I mean, it's like significantly higher. And the variability of that volatility, meaning that if you were to look at it in 10-30 times, the volatility is twice as much in a 60-40 as it is in a 70-30, but the predictability of that volatility is like twice as much as well. So it's really a swing there versus a lower equity. And so if we talk about, well, you want to have a set asset allocation of 60-40 so that you can really hone in your risk on your portfolio.  I mean, you're not going to hone in the risk of the portfolio. If you have a lot of equity, you're just simply going to have a lot of risk. So in my opinion, there needs to be a lot more work done and maybe some better language out here about the benefit of rebalancing. Anybody else? The data actually shows that most financial advisors do the opposite of rebalancing. There was a lot of data that showed at the height of the market in 2007 very heavy stocks at the bottom of the market, March 9, 2009, had turned to cash. So, I mean, rebalancing is good. I agree that it can be done overkill. I don't think there's a penalty to rebalancing too much other than the transaction costs and the taxes. But that rebalancing is primarily managing risk, but it also is a market timing strategy that actually worked. It's everyone we love to call ourselves contrarians, but it's really hard to buy stocks after they've fallen 50%. I love your point, Alan. And the other thing is, when we look at our investor return data, and we've talked about this before in this forum, that sort of dollar-weighted return data that captures investors' flows, we're looking at all investors. So it's not just the dumb individual investor you often hear about makes these poor timing decisions. Advisors do it, institutions do it. When we look at target-date funds repositioning in the wake of the bear market, what were they doing? Well, they were adding to bonds, of course. And what have they been doing in the past couple of years? Well, many of them have been adding to equities, again, like fidelities. So there's plenty of blame to go around in terms of these timing errors. And I agree that it's sort of an enforced discipline. Rebalancing helps get you headed in the right direction. Just one topic that has been touched on, but we haven't actually stated it. People talk about the tax cost of rebalancing. If you have taxable accounts and tax-sheltered accounts such as IRAs or 401ks, to the extent possible, you want to do rebalancing in those tax-sheltered accounts so that there are no tax costs. And that's a problem if you're doing tax location where you have most of your bonds in your IRA. There's usually stocks that go up. The stocks are all in your personal account and you need to do a rebalance and you're actually going to incur higher taxes. And so it becomes counter to asset location. Did we solve any problems today? I think that Alan did it. Whatever works for you, just be disciplined about it. That's the right thing to do. I used to say if you can't be right, at least be consistent. I've changed that view. The consistency is more important than being right. Okay, the next question from the panel. Can you provide some simple, high-level guidelines for tax-efficient withdrawals in retirement? Sure.  If you expect to leave a large part of it to your heirs, leaving behind a large taxable account is often very efficient because it'll get a step up in cost basis, which is to say that their cost basis when they inherit it will lead you to the market value when you die. Conversely, if you expect to spend it down during your lifetime, then the taxable account is now the least efficient one, so it's usually the one they want to spend from first. And then as far as spending between Roth accounts and tax-perit accounts, the question is just the same one that you've been looking at forever in terms of which one to contribute to is just flipped on its head. Is my marginal tax rate higher now than I expected to be in the future? Or is it lower now than I expected to be in the future? And if your tax rate right now, when you're starting to take money out, is lower than you expected to be in the future, perhaps because you haven't started taking Social Security yet, that's when you want to spend from tax-perit accounts. If your marginal tax rate is higher now than you expected to be in the future, then that's when you would want to prioritize spending from Roth accounts. There's nothing... Investing is simple, taxes aren't. You know, there are rules of thumb that work sometime probably more often than not, don't work. Sometimes it's better to pay taxes at a lower rate sooner than at a higher rate later when Social Security kicks in. So a bunch of different rules. I use a strategy of multiple Roth conversions with being able to recharacterize or hit that undo button the next year to kind of manage the marginal tax bracket and then to essentially sell it back to the government if the asset clash to the conversion to goes down. I think another thing that these guys alluded to that is really important is the benefit of tax diversification which is something that this audience knows well, that the more different pools with different tax treatments that you can pull from, the more you can sort of manage those tax brackets on a year-to-year basis. I think sometimes people want that rule that they're just going to be dogmatic about, well, deplete this and then move on to that and move on to that. And in reality, I think if a tax advisor were to look at it, he would say, no, maybe you could take a little bit of this year and a little bit of that, rather than just sort of sequentially going through each pool of assets. Sorry, one more thing to add. A lot of times people make the mistake of thinking that their marginal tax rate is the same as their tax bracket and that's very often not the case, especially once you're retired because there will be various tax breaks for which you qualify, for which you will not qualify if your income grows too much. So for instance, one of them is social security. Often none of it is taxed. At the most, 85% of it can be taxed. So when you're receiving social security, you're in this time where additional income not only causes the normal amount of income tax, it also causes more social security to become taxable. So even if you're in, let's say the 15% tax bracket, you get a marginal tax rate of 22 or even 27%. And there's another similar sort of thing going on if you retire prior to Medicare eligibility and you're buying insurance on the exchanges where additional income can cause the size of your subsidies to go down. So effectively your marginal tax rate is much higher than the tax bracket you're in. So often the best thing to do rather than just looking at the tax brackets and saying, oh, I'm estimating my income will be such and such amount, is actually to plug numbers into TurboTax and then move them around a little bit. If I have like an extra $1,000 of tax per distributions, how do my taxes change? Because that's our actual marginal tax rate and it's not always going to be the same in your tax bracket. Okay, the next question for the panel is, what are your thoughts on obtaining long-term care insurance versus self-insuring? What asset level would you need to be after you decide to self-insure? And then the thoughts on the viability of long-term care insurance product. There are new blended products that may include annuities and or life insurance. Ages are in the mid-60s. Anybody have any comments about long-term care? A lot of questions there. I don't have a hard and fast number on when you should, and I've been informed and I think it's a true assertion that self-insuring is not a term in that when you're insuring anything you're pooling your risk with other people. So it's sort of, I prefer self-fund when we think about paying for long-term care out of pocket. I guess I'll share a story though from my personal life, which is that my mom and dad I think had been informed or had been advised to self-fund for long-term care costs. My dad had dementia and my mom needed care in the home because she had more healthcare considerations, so at some point we were in a situation where my dad moved my dad to a facility with his Alzheimer's to give him more care, and yet we still had caregivers at home for my mom and as the person not writing the checks out of my own accounts but as the person overseeing all of this you can imagine that certainly in a big urban area that gets very expensive very quickly. So if you're sort of thinking about self-funding, long-term care really run the numbers on what these costs could look like for both you and your spouse and think through kind of the worst case scenario. In terms of the viability of the long-term care insurance market, I think that arguably the pricing is as bad as it's going to get in terms of long-term care insurance if you're purchasing a new policy today, given how low interest rates are, given that insurers know what they know about how bad their claims experience has been that they're pricing it pretty aggressively to protect themselves on the downside. So I know Michael Kitsis has argued that he thinks that perhaps the worst is over in terms of long-term care premium increases. I'm not sure whether that's true, but I guess the more that I experience this, the more that I put myself a little more in that insurance camp as opposed to this idea of self-funding. It's one of a few subjects that I'm actually agnostic on. It is true insurance and I'm a believer in buying insurance, but you can't buy it anymore because of the underpricing and trying to buy market share. You can't buy it anymore where your rate is going to be fixed. So you could end up paying for it for 10 years and then many consumers now are getting a 100-150% price increase. So I do believe that if you can self-fund self-insure that's probably the way to go. I don't have it. As far as one easy answer though is the question of should you mix it with a whole life or a universal life or other products just help that with is my answer. Okay, this is for refaring. What role should a REIT fund play in a portfolio for someone who is 8 to 10 years from retirement and where is it best placed in a tax deferred question? So REITs are the only alternative asset class that I actually include in a portfolio and normally it just goes into the non-taxable account. In fact, the perfect place for REITs is IRA because it has both income and growth. If we can't go into a Roth we go into a regular IRA but REITs are a different animal than common stock because of flow through they don't pay any taxes at the corporate level as long as they distribute 90% of the free cash flow to shareholders then it's a flow through limited partnership. The underlying premise of REITs is that people rent apartments, they rent office space, they rent store space now single family homes and they pay rent and the income from REITs is fairly stable even during economic downturns so REIT prices will go up and down. The income from real estate is fairly stable even during the crash in 2008, 7 and 8 early 2009. So it actually becomes a different animal and there are times that REITs like the Vanguard REIT ETF which is very low cost and broadly diversified into equity REITs that are different type of REITs will be negatively correlated with the rest of the stock market. So by having an allocation to REITs and I think 10% is about right you can gain some diversification benefit and also gain a little bit more income in your portfolio because of this alternative asset class that's where I... Rick I have a follow up question for you on this in terms of my personal property ownership what does that factor into my REIT ownership and also what do you think about direct ownership of property because when I think about some of the most well off seniors I know that's in the mix for them so is that a good idea? Never a good idea because it's too undiversified an asset? Well I think that it complements each other as opposed to one or the other owning a home, owning some rental property it's very localized and of course the cash flows are better if you're well managed and it's a good location REITs are you own a thousand properties thousands and thousands of properties all over the country and I REIT index so you're getting the market based return real estate and to me if you're able to have rental property if you are doing it directly by buying properties or single family homes or apartments or maybe you're getting involved with very good people who you know personally who are running partnerships that's a diversification I consider it a compliment as opposed to one or the other and I don't want to get involved in people who you don't know when it comes to private real estate Okay, here's a question for the panel from Samuel Moller Can you buy an annuity in a Roth an SBIA is it a good idea if you're in a high tax You can buy IRA annuities basically in terms of income annuities I'm not aware that you can buy one within an IRA as such you can move a portion of your Roth IRA to an IRA annuity it functions the same way where the payouts from if it's a Roth the payouts from it would be free from income cuts you know in most cases I would say the Roth money is the last money you want to use so I would probably recommend against it but I'm not against annuities and the best deferred annuity out here is delaying social security What do you see and the ideal amount of inflation protected security is once you have an account paying an account key variables such as age so forth and why What do you see as the best vehicle for this investment Vanguard fund, actual bonds I'm trying to see the range of responses from experts to help target an appropriate amount for our portfolio I will just talk about what Ibbitson puts out in terms of recommended allocations for accumulators certainly young accumulators nothing in tips or I bonds or anything like that the basic idea is that that human capital over time should be somewhat inflation adjusted that that person should qualify for cost of living increases as the years go by with their salary and then the tips allocation begins to step up for people who are in their 50s and 60s and so on I believe at the high end Ibbitson would recommend like a third of overall maybe a fourth or third of overall fixed income exposure going into something that's inflation protected I believe in the asset class but the answer is definitely it depends I mean if you're a government employee you have access to the G fund which is like a intermediate term treasury with no interest rate risk that's a much superior product I'm also a believer in certain CDs as Bill Bernstein mentioned but I like the asset class the single best vehicle in my opinion is the Vanguard inflation protected the intermediate term not the short term and then if it's a ETF probably the ice years tips even though it has a higher expense ratio I believe it Christine you don't think people don't really need tips because in the long run stocks are going to take care of any unanticipated inflation that we might have and when the short run stocks are not the ideal anti-unanticipated inflation vehicle tips are but I'm not sure younger people really need that protection the bond portfolio that I run where a retiree may have a greater position in bonds would have 20% in tips in it and the rest of the bond portfolio is intermediate term and I think that may be enough but I'm not going to state that if somebody wants to 30% that's fine it suits you, makes you feel comfortable the great return and risks are not that much different I would also say that it depends from one retiree to another some are more exposed to inflation risk than others if you own your home you have much less inflation risk than somebody who's renting if you have a pension that's inflation adjusted that satisfies most of your basic needs or all of them inflation risk than somebody who has only social security and only satisfies very small part of their needs so it varies even among retirees okay here's a question from Steve Hewitt is the three fund portfolio the best asset allocation choice or is tilting a small cap and value better over time here we go again the answer is yes no okay can I give my little feel about the difference between philosophy and strategy here oh absolutely as long as it's not political okay so here's my two minute version of what we all do as investors and how we become successful investors investing is divided up into three parts first you have a philosophy what do you believe about the markets now is anybody here not a bogelhead I'm pretty sure if you're not a bogelhead please raise your hand okay so everybody here has the same philosophy correct how many people in this room have exactly the same portfolio nobody because that's strategy so strategy is taking the investments that are out there you have a lot of products can I so you have the philosophy of a bogelhead low cost poorly diversified on friday time in the market all the good bogelhead believes and now you look at the investments that are available and we're going to build a strategy strategy is personal refund portfolio that works heavily tilting towards small cap value that works it all works if that's your strategy as long as you do the third thing which is have the discipline to maintain the strategy it will work and who's going to say whether a tilted portfolio is going to outperform a refund portfolio no one in this room can say that I don't know but if it's your strategy to do that as long as you implement that strategy and maintain that strategy with discipline and continually remind yourself while you're doing that through education then the whole thing works and you'll be a successful investor if you break any link in that chain then you're not going to be successful at it if you lose the philosophy if you keep shifting the strategy if you don't maintain the discipline it isn't going to work no matter what you do that's my answer anybody else as the author of how a second grader beat Wall Street if you look at the eighth lazy portfolio as the last I looked the refund second grader portfolio was in first place okay here's a question from Dr. Karen Oates what he found is that new research he continues to provide new data which is spending heads how does his research impact on the scholarly research of the distinguished panel? you know of course Wade is doing great work and I read his research it makes a lot of sense and it's changed my thinking as I already have alluded to I think this is a huge issue and it hasn't been given enough thought and so I think Wade is doing great work anyone else? I'll just comment my colleague at Morningstar sort of Wade's equivalent to Morningstar David Blanchett who sort of had a retirement research and he continues to conduct research into this area of sort of optimal retiree glide paths his conclusions are different from Wade's he believes in the traditional glide path where you actually get more conservative as the years go by his assertions and he's not here to talk about it but he and I have talked a lot about it his assertion is that the differential the improvement that Wade and Michael Kitzis have identified are is minor psychological impediments that might accompany a higher equity glide path in retirement so that's kind of where he's coming down and that's the direction that his research has been pointing in in support of a more traditional in retirement glide path so it's safe to say that Morningstar will sort of be in that camp for now and David Blanchett Michael Kitzis and I were on a Morningstar panel talking about the glide path and I'm on David's camp and I have a lot of discussion with Wade on this who I have immense respect for the difference between the glide path and the increasing glide path is immaterial that's point number one point number two is behaviorally it's almost impossible to get people to stay in the course much less increase equities after they plunge and then finally I did my own simulation that I discussed with Wade who I believe agreed with showing the impact of the expenses and emotions you know take that three and a half percent down to about two and a half percent and that's the key factor not performance chasing and not paying fees much more important than the glide path. Okay the next question I'm a retiree I live partly off my portfolio and therefore sensitive to its volatility. Currently my bond allocation is dedicated entirely to the end of our total bond market index fund in light of future interest rate increases should I change this allocation perhaps I should diversify into short-term bond fund or is it some other strategy to cope with this risk or should I just do nothing in legal law? Well I'm not Bill Bernstein I say you do nothing and leave it alone try to time interest rate movements is extremely difficult at least I can say about the stock market over time it's going to go up and it's going to hit new highs I guess with interest rates the best you can say is they probably won't drop below zero that's all you really say about them after that you really don't know so I would say that your liabilities if you retire or intermediate-term you should have maybe a short-term bond fund to cover one or two years of living expenses as an emergency fund but after that I think you could have intermediate-term bonds I don't believe in short-term bonds number one last year 44 out of the 45 economists interviewed by the Wall Street Journal forecasted that the 10-year T bond would go up this year and up significantly one set flat net set down second piece of data is those economists have a track record of being directionally correct about a third of the time less than a point flat and then third, a strategy that I use of CDs that have easy early withdrawal penalties is you kind of an intermediate-term return and you can get that easy penalty to get out that breaks go up and have much less of a downside than what might happen to T bond if interest rates did rise Goldman Sachs can't take advantage of it because $250,000 of FDIC insurance is rounding error to them but it is a marketed efficiency created by the FDIC and the NCUA that really gives us the ability to outperform or above market return I like the idea of having some sort of dedicated cash piece in addition to maybe an intermediate-term bond fund market or otherwise that's kind of the strategy when I talk about this bucket system of retirement planning, the basic ideas and there is a drag of having some cash in your portfolio course relative to having it invested but the idea is that your long-term portfolio including your intermediate long-term portfolio those pieces will do what they are going to do and they'll maybe be a little bit volatile but you know that you have your near-term living expenses locked down with cash instruments, that's why I'm a believer in that strategy I think it works from a psychological standpoint that it helps the retiree tolerate those fluctuations that accompany stocks certainly but possibly bonds over the next decade or two and if you are going to have cash put it in like a selling may or money market that's paying .9% because a Vanguard prime money market will double in only $6,972 for the panel what's the panel's view on non-cap-weighted index products assuming implementation was relatively low cost 30 to 40 basis points and turnover was modest where could they be most effectively used in the diversified equity portfolio such as domestic large caps, small caps small cap value international so non-cap-weighted is simply means you're taking a bet toward mid-cap stocks you take the S&P 500 and you non-cap-weighted you just do an equal weighting per se and you're really really close to a morning star mid-cap style box you're just sitting right on the cost of large cap mid-cap I think you bring the market capitalization of the S&P from about 50 billion close to maybe 11 billion so you're making a bet on mid-cap and if you want to make a bet on mid-cap stocks then I think that you probably do it cheaper than buying a mid-cap index fund that's cap-weighted and I think that Gus talked about this there's cheaper ways to get there's risk exposures in your portfolio if you don't want to do all cap-weighting then doing an alternative weighting portfolio anyone else? I agree I must be wrong I should change my mind this is a question that I asked the last panel life has repeated for this panel to see if there's any difference of opinion the question was be interested in hearing the panel's viewpoints on portfolio construction in retirement based on three different approaches the age in bonds the bucket approach I'll take the bucket one that was the one that I just talked about the basic idea and I've written a lot about this on Morningstar.com I've kind of illustrated the logistics of this and to get people off this income only mindset which is something I confront a lot of my work where retirees want to just try to subsist off of whatever income the portfolio kicks off so the basic idea is that you've got one to two years worth of living expenses and true cash instruments maybe income for years three through eight or three through ten of retirement in bonds and then everything else in stocks we sort of arrive at those allocations by thinking about well 95% of the time equities are in positive territory over a rolling ten year period ten year time prize and it seems like you could reasonably put everything for those years in stocks and so the idea is that you're using your income distributions from the rest of the portfolio to fill up that bucket one as you complete it as you spend that money in it and if that doesn't get you there then you turn to rebalancing proceeds to help fill up that bucket one so I think it's an easy strategy to understand it's an easy strategy to explain hearing from our users I get the sense that people have some success in keeping this strategy going in their portfolios I think it works from a psychological standpoint and I would take pains to note that this is not original to me this is really Harold Vensky's strategy something at least used with his clients and I have just taken the strategy and illustrated it with actual fund holdings but you can find a lot of work on that topic including some stress tests of my bucket portfolios that sort of show well how did this work on a year to year basis where did we go for cash and some years the income distributions were enough and some years we had to pull from some of the longer term investments so my idea is just to kind of illustrate the logistics of this which I think for a lot of individual investors trying to figure this out themselves can be kind of black boxy so I've just been trying to present new life portfolios and show how the cash flow process would work Economic theory would say the bucket approach is bunk but economic theory seems we're all logical rational beings in reality we're feeling being so I come to totally agree with you that the bucket approach kind of psychologically helps one to stay the course as far as the liability matching strategy that's certainly the safest choice for those who aren't familiar with the term it's basically just one method of implementing it would be a tip slider to the extent you can build one if bonds maturing every year to cover your living expenses but as Jack said that's super expensive it takes a whole lot of money especially with the tip seals as low as they are so one method that I think makes some sense is to use that strategy but just for basic needs the stuff that you're absolutely unwilling to compromise on to the extent that your social security pension or other sources of income don't satisfy those needs a liability matching portfolio to satisfy the remainder of them can make sense but again it's going to be expensive that's a good question in the end it's going to be whatever strategy you can maintain but now I'll keep you further I never liked age and bonds it just seems counterintuitive to me that if you're 40 years old you should have 40% of your portfolio bonds just because you're 40 years old or if you're 50 you should have 50 just because you're 50 I think that if you have no other way and nothing else to look at I think age and bonds is maybe step number one but you can quickly go up the ladder to better methodologies than that I mean even if you start if you're going to accumulate assets you have a 60-40 portfolio and when you start accumulating assets you start with a 30-70 portfolio and you work from there but the bucket approach it makes sense it gives you a plan for getting income and of the three choices the bucket approach to me makes the most sense I'm giving a talk in about a month to a group of financial planners who definitely believe in the liability in fact they take zero coupon treasury bonds and they ladder them out 15 years when somebody retires for the first 15 years of a person's retirement they're going to do a structured laddered zero coupon bond portfolio and I say wow what a tremendous amount of interest rate risk you take when you do that too to one day structure a laddered portfolio of zero coupon bonds out 15 years you better hope that interest rates don't go up over time and you kind of shot yourself in the foot so I'm not all Mike makes a good point about perhaps doing some liability matching with zero coupon bonds or treasury treasury tips in a very short run but I think that the three choices the bucket approach makes the most sense next question is from Ray James given the mantra lifestyle and spending won't increase without pay rises but the future education costs continue to rise as rapidly like the stock market does education and health care pricing at some point return to the median and any advice on the best investment to protect from these future costs that are available today it has to return to the median at some point otherwise it becomes the entire economy which of course doesn't make any sense as far as how to protect against health insurance as far as how to protect against education costs I'm not really sure I think we've seen some preliminary preliminary signs that both sets of costs are starting to modulate a little bit certainly with the health care numbers that we see I won't get political but I think that there's some indication that perhaps the Affordable Care Act has helped drive down health care costs a little bit and we are also seeing and I have a colleague who works college savings front almost full time and just talking about funding 529 and all that stuff and watches college costs very closely and what you continue to see is that costs at the very top tier of universities they can continue to push through those increases in tuition but kind of at the middle ground and certainly the state universities continue to be very constrained as well in terms of being affected by the budgets but kind of the middle ground some of the smaller schools the smaller private colleges have in fact begun to modulate tuition increases a little bit we've even seen some declines so I hope that trend will persist in my past life a long long time ago I was director of financial planning at the corporate office of Kaiser Permanente and a lot of money betting that price increases would have had to collapse a long time before where we are now so it is a big threat health care in my opinion and we're not supposed to be political but I'm not optimistic that our politicians are going to work together to solve what I think is a huge problem but sooner or later it has to collapse education sooner or later it has to slow down neither can be 110% of our GDP this relates to our cognitive facilities decline as we age the question is please provide suggestions on how we simplify our lives in retirement for example is putting investments into a single target retirement fund and getting automatic monthly withdrawals like living out of time I'll take that because it's interesting as I've worked more in this retirement planning space and worked on the logistics of these bucket strategies the more I've realized you know this is even a simplified version of a retirement portfolio is pretty darn complicated so I think if you're the person who's the main person in charge of your family's household finances I think it's really important to start thinking about how do I simplify this portfolio how do I create a succession plan for this portfolio especially if I have a spouse or maybe I don't have a spouse how do I simplify this whole thing for myself and so I often hear that maybe a one fund solution is a good idea my big issue with that approach whether it's a target date fund or some sort of a good quality balanced fund is that when you take those distributions out you're getting a portion of your stock holdings and you're getting a portion of your bond holdings back to you at the same time in 2008 you did not want a portion of your stock holdings sent back to you you wanted to be able to pick and choose you probably wanted to drop from your safe stuff and leave your stocks there to rebound so I like the idea of I think a better alternative would be perhaps to have just a couple fund portfolio or whatever it might be or I think that Vanguard's managed payout fund and I know there was some talk about it on the previous panel I think that's actually the right mouse trap in terms of a more intelligent distribution setup and I expect to see more funds in that vein when I think about sort of the suite of retirement income funds that are out there in my view that most of them are not really ready for prime time but I do think that that managed payout fund in that the distributions can come from a variety of sources income sources return on your own capital which a lot of retirees have a big psychological impediment but sometimes that's the right answer I think that that's the right direction and I would expect to see more growth in that area frankly I'm surprised that the managed payout fund has kind of struggled a lot because I think it's a very, very good product I researched this extensively for a piece that I wrote for AARP magazine and what I came down to is the best protection is simplification having a family member that you know and trust you know what their key incentives are SPIA single premium immediate annuities they do protect you from mistakes later in life but I think that they are still oversold we're all concerned about do we want to go over your media term which in short term nobody would think of what a SPIA is it's a bond fund it's a bond with the duration for the rest of your life I think aside from your portfolio there's other things you can do to simplify just minimize them bank accounts you have buying IRAs, holding formal case into IRAs now there's some tax consideration like not necessarily want to do that pay off your mortgage delay social security so that there's no decisions to make once you start taking social security you don't have to manage it the way you manage your portfolio so there's a lot of things you can do to simplify things aside from cutting down the number of funds that doesn't really appeal to you I'm just going to change the subject a little bit I've been approached at least three times at this conference with the same question or the same comment so I'm going to address it I'm one of you I have a real concern about my spouse she doesn't really like this stuff you know I come here I love this stuff so I told her about you and when I die she's supposed to call me how many phone calls have I gotten in the last 11 years of coming to these conferences where the spouse has called me and this is good news for you because none of you will ever die the answer is zero so if you out here who are well educated and you're sort of taking the the lead and figuring out what you're currently doing with your own investments and if you want your spouse to work with an advisor in my island or anybody out there just telling them to pick up the phone and call that advisor or email that advisor when you're dead doesn't work there needs to be something else some sort of a relationship needs to be established with you, your children, the advisors they have a warm and comfy and understand the philosophy and perhaps understand the strategy as well discipline in order to make the transition of wealth because I can tell you just by telling your spouse call Alan or Paul Rick or call someone else in the audience or whomever it doesn't work that long lost cousin from Merrill Lynch always seems to show up in the way and the variable annuity sales pitch begins questions for the panel from Samuel Lawler evaluate the risk of waiting until later in retirement to buy an annuity assuming a pension and social security doesn't cover your expected spending you know the older you are the more life credits you get buying an annuity and again the single best annuity and the way I framed it for a client who wanted to buy a SPF and take social security early was deferring it from four years from 66 to age 70 was like buying that deferred annuity at a 45% discount so again the longer you wait buying a SPF the more life credits you're getting and then less that goes to intermediaries that profit the agent that sells it to you and the insurance company needs to make a profit and essentially they're taking your money and they're putting in about the 85% in bonds and 15% in stocks and alternatives so it's an indirect more expensive thing to get but it does provide those life credits against you know longevity this is for Kristi we are to retire in two years we will roll over our IR 401K and demand guard what is the easiest place to put our middle budget so I guess the question is well the way I think about segmenting the portfolio in terms of the bucket strategy I kind of said it that we've got cash for very near term living expenses then generally fixed income instruments for bucket two which is probably three to eight years worth of for years three through ten of retirement and then stocks beyond that so when I think about that bucket two I think about mainly core fixed income instruments maybe total bond market maybe some little tweak to give it extra emphasis on corporates I also typically put in and I know Rick doesn't like short term bond funds would put in a short term bond fund sort of at the front end of that bucket two the ideas in some sort of catastrophic scenario where the retiree has gone through bucket one and there's nothing can't shake out any living expenses or enough living expenses from the portfolio to refill it that you would turn to that short term bond fund as your next line reserves so that's kind of how I think about structuring it at the tail end of bucket two you might also think about having some sort of a balanced fund whether it's something like Wellesley income or Wellington even to give that portion of the portfolio just a little bit of a growth boost this is one for Rick I'm age 63 and will probably work for three more years thinking of converting all or most of a small traditional IRA to a Roth IRA before 70 and a half what is the best time to do the conversion and what should be some consideration I'm actually going to pass on that that's a tax question and I'm not a tax expert so I'm actually going to pass on that Pass it to Mike We were talking about it earlier it's just how your current marginal tax rate compares to the tax rate you expect to have in the future if your current marginal tax rate is higher than the tax rate you expect to have down the road Roth conversion do not make sense if there's a possible exception if you think you're leaving money to your ears that you're comparing it to their tax rate actually but the most part unless your tax rate now is lower than the tax rate you expect to have in the future and again this is a marginal tax rate then Roth conversions would not make sense although Roth conversions Roth conversions do give you some tax diversification and I think the question was on timing the best time to do the conversion is January 2 the first day the market is open and you have until October 15 of the following year to hit that undo button to do that you know recapitalization to undo it and tax planning that recapitalization helps a whole lot as well as if the asset goes down you hit that undo button and make the government buy it back at the original price so I do multiple Roth conversions on my own account every year in terms of the timing from not within the year but one year as opposed to the other a lot of it depends on whether in your early years of retirement you will be buying insurance on two exchanges if you are not retiring until 65 that's not a concern until Medicare if you have insurance through a former employer not a concern but if you will be buying insurance on those exchanges you can often qualify for significant subsidies if you make a point to keep your income low and Roth conversions would really kind of ruin that so in that case then you've got this let's say you retire at 60 for five years and then you're starting Social Security at 70 it's those years after you're finished buying insurance on the exchange so starting at 65 and before Social Security kicks in at 70 that would be the range when you're most likely to want to be doing the conversions the follow on question are international bond funds really necessary is there a currency risk associated with them and can't one get the benefit of an allocation to bonds with total bond market there okay I can answer that the international bond fund question I'm agnostic you know these are interest rate bearing bonds and you know whether they're from Europe or Japan and then you hedge out the currencies and that's a little more costly but the cost of the bond fund is a little higher hedging up the currency is a little higher you're sort of eating away the income from the bond fund I think that you could do all the analysis you want about the diversification benefit of it and how having foreign bonds might give you incrementally a little bit better rate of return on a risk-adjusted basis but after the cost of hedging after the extra fee I've never really been sold on the idea of adding the international bond fund even the vanguard bond fund and interesting that Gus was talking about that dinner that we had 10 years ago but one of the other things that Gus and I discussed in that dinner was why doesn't vanguard have an international bond fund and if Gus is still in the room is he? I don't think so but his answer was I don't see any point to it and I said I agree but people want it so I think that vanguard sometimes creates products that people want them and then they create the theory after that and it's exactly the criticism that Gus had for smart beta I think that you could say that vanguard is guilty of the same thing they do create products because people want them not necessarily because the people at vanguard actually believe in them and if you ask me or if you have asked Gus 10 years ago he would say I don't see the need for it vanguard has been talking to me about international bonds for many many years I really did believe it was a 20 year product launch and their argument is really good since I believe in international stocks why wouldn't I believe in international bonds for diversification and I researched this and researched this and eventually came out kind of lukewarm I bought a little bit myself but my tone of water was what vanguard was hoping for and the two reasons yes it's hedged to the US dollar which I have to agree with but with 20 bips plus another 5 bips or .25% in total the other 5 bips comes from the hedging cost it's 3 times more expensive than total bond and let's face it if the vanguard total bond market goes to zero that means the treasury has gone to zero and if that diversification is not going to help I kind of agree with what the panelists have said I think though vanguard's product is a good product certainly relative to other international bond products on the market what I would say is when I look at this category it's one of the most diverse of any that we track so there are all sorts of different strategies going on and really the key differentiator one of the keys is this currency hedging thing so we would most of the clients are strongly favor the hedged type product because the unhedged product act very unbond like so you have a lot of currency related volatility so while we favor the hedged products I think I generally agree with what the other people are saying this is a question for Rick reading much about the world economy slowing and the potential for stagflation deflation any strategies you recommend for a stagflation deflation environment well if I knew for a fact that we were actually going to go into a stagflation deflation environment then maybe I could create a strategy that would advantage of that and I could get 2 and 20 on my hedge fund state of course I mean you've got a strategy stick to it if there's a little stagflation or deflation and reverse eventually you better off just staying the course bonds in fact vanguard's economic model that I looked at showed a 15% probability deflation over the next 10 years I spoke to Roger a couple of days ago and he said they decreased that probability now but again what will work treasury bonds in a deflationary environment go along but again since we don't know what's going to happen is the yield curve is still relatively steep I believe in the intermediate term part of the yield curve plus CDs of MN CDs I've got a couple of questions left this is for the panel since interest rates are so low are stock funds better held in a rock than bond funds? well if I could get all of my money into a rock that's where I hold it but are stock funds better in a rock than in a bond fund that's again that is to be a tax question if the market goes up a lot then yeah I think so if the market doesn't go up you probably want to bond in your rock but again we're getting into asset location strategies and where should you put your assets based on where taxes are today what your income is today trying to anticipate later on down the road what taxes are going to be later on down the road and what the growth of these assets are going to be very very difficult to do as Alan pointed out taxes are much more difficult to try to figure out so the question again was getting back to you question was would it be better to put bonds or stocks in a rock I think was a bottom line for the question I think it's a time pricing question really I mean you should let that dictate what you hold in that account based on when you weather and when you expect to tap it's certainly if it's something that you're leaving to kids and grandkids I would put long term high growth stuff and if it's something that I expected to need for my living expenses I'd have it shortened up accordingly I think I think that you want to locate stocks first in your taxable account then you're raw and the least efficient places in your IRA like you I think you may disagree and we're going to have a talk and this guy is really really smart and I may be wrong I generally wouldn't put anything in taxable unless you have to that's where we disagree but I still agree with the typical asset location advice that you'll find on Bogleheads which is the tax shelter your bonds would just say retirement account prior to tax shelter in your stocks even though interest rates are low right now now that said the advantage of doing that is certainly less than it is when interest rates are quite high but we don't know how long interest rates will stay that way but the thing about how tax laws change obviously market conditions change too so basing an asset location decision on exactly where interest rates are today isn't necessarily a great idea now we get into this tax location discussion and you know you could need to try to locate all the tax inefficient stuff and your retirement accounts and your more tax efficient stuff like stocks not vanguard per se but other stock ETFs there's a real tax benefit if you're going to do anything other than a vanguard fund if you find an ETF that does it in its equity you probably use the ETF because of the tax efficiency of the way ETFs are now vanguards are a little bit different but this debate between should you do the same asset allocation and all your accounts are pretty close to it or should you do tax location it just keeps going back and forth and back and forth there's benefits to doing one where it's simple and you don't get fixated on one account and what's going on on that one account and there's benefits to doing it the other way so I don't know this is one of those questions that is probably never going to be resolved because we don't know what the future of taxes are you know they changed I mean the last few years this whole equation has changed because now dividends are being taxed at a higher rate capital gains are being taxed at a higher rate plus we have the medical tax on top of that the whole equation changed as taxes changed so it's difficult but if you're talking with somebody who's not that sophisticated who doesn't get into all this stuff too much I'm in the camp of doing the same allocation in both accounts taxable versus non-taxable because it's simple for them and they won't fixate on performance of one account so you do a balanced fund for example in both accounts as opposed to trying to do stocks and a taxable account and bonds and retirement account because they'll just fixate on that one account and they'll probably do the wrong thing at the wrong time so it's a sophistication level also of the individual that matters here the final question is for Rick and Alan has there been any progress on nominating Jack Fogel for the presidential number 3 I'm answering Jack's not here the answer is what I know is that the process has been as far as it can go so all the paperwork has been done I'm not mistaken at all if you're involved in this or not but now we have to wait through the political process of it and this is an election year and things take time thank you panel for participating


t having eight out of eight seven out of seven All right. So the next one as factor true What is the class of this? What is the type? Right? We are now getting interesting questions So we're getting answers like functions. We didn't do functions yet Um, oh on zoom. We have one which is correct factor. This is a factor. I take a logical value And I convert it to a factor because as factor means that make a factor out of the value that I give it So the as factor will always return a factor Um, because that's what the aim of the function is So factor good last one and then we have a couple of slides left and then we're done for today So is character one e plus 11 What is the type? What is the type of this? all right on Zoom i'm seeing Good answer lando. Good answer Good answer. That is indeed correct Leonardo says logical Shea Vash character Yeah No, this is a logical, right? Because is character ask a question, right? So the answer to this question will be true Or it will be false And the type of true or false doesn't matter what the answer is right is going to be logical so, um The answer to is character Um is in this case true and the type of true is logical So all right. So just quick recap quick recap character character numeric numeric comment logical factor logical interesting, right? Um It's just something that you have to deal with um and The exam won't be that much more difficult, but I will do my best to trick you guys and um, that's the only trick question That's going to be in the exam. I promise um Because the other questions are not going to be any trick questions or something like that. I'm not like that But this one I always try to come up with Being as creative as possible To make it as hard as possible for you guys to reason about what the type is, but you guys did very very well Um, that's uh, like eight out of eight for a lot of people. So yeah You are paying attention even though it's an online lecture. That's that's very good All right, so we talked about the list Right so that the list can contain anything and that you can put in whatever you want So I gave you this kind of an example where we make a list where we have a character vector of length one um with the name name and the content fret Then we have numbers um with the name numbers and then four numbers in there We then have another number Vector of length one 5.3 And then we have a matrix. Um, so in the last position I now put a matrix, right? So this is a two by two matrix Um with zero one one zero zero one in there So if you want to select things from a list You have to always use double square brackets And that is the only time in art that you use the double square brackets So when you are selecting from a list you can either do it by name, right? So if I say w dollar numbers, then it it will know that okay, so from from w Um, select the thing that has the name numbers and then in this case combine two and three Which means select the second and the third element If I want to select the first thing right if I want to select fred and I don't want to use the dollar name I can just say w Two square brackets open one two square brackets closed and then select the first element Because although it is a It is a single character value in r. It's still stored as a vector, right? So I still have to say select the first element from it Um, if I want to select from the matrix element here, um, then it is w four, right? In between two square brackets comma one and comma one means select all of the rows From the first column I can also just use this w dollar matrix one comma So when dealing with lists, my advice is to always name the elements of the list. So say Something is yes, so give it a name. So say element one is fred element two is Because it just makes it easier to select from a list Sometimes you run into issues or you deal with a package and this package doesn't name the elements of a list Um, and then you are forced to use the double square brackets So this is the only time in r that you use double square brackets and that's just difficult. Um, and it it It's it's the way that it is I can't change it But this is the way that you can select or index in a in a list element in r All right So there are some additional functions that I did want to introduce because they come back in the assignments So we have a function called n row, right? So n row round bracket open and then when we give it a matrix object, right so Something which is of type matrix. It will tell you the number of rows The same thing holds for n coal Of a matrix that will tell you how many columns there are in a matrix And this will be very important when we start looping, right? So when we start going through Every row in the matrix or we start going every row in the matrix or when we start going through every column in the matrix Right, then we are going to use n row and n columns Because we're not going to hard code it, right? That's bad. We're not going to say four x in one two six We're going to say four x in one to the number of rows of the matrix If we want to know the row names or of the column names of a matrix We can use the row names function or the column names function And we can also use these functions to assign row names and column names to a matrix So let me quickly demonstrate that for you guys because I think we have a matrix, right? We have y which is our matrix So I can say for example row names of y Is and then I can say row one Then I can say row two Row three and then say r four just because I'm lazy and then r five, right? So now when I Print my matrix you can see that it now has row names I can do the same thing for column names. So let's assign some column names as well So I can say the column names of y is Repeat No, not repeat is a sequence from five to ten. It's only four. So it's from five to nine How do you mean it's not What sec five comma nine Oh, that's way too much five to eight. Sorry Five to eight. All right. So now when I say why Right, and now I did something very very dumb because now I gave numerical row names to this matrix So now when I say select So now I can do why and then give me five And then it will give me the first row. So that's dumb, right? So if you use row names and column names always make sure that it's it's It's logical, right? So not that you start renaming rows saying that row number one is actually called five And row number six is actually called two Right that will just make life harder on you. So always when you do something like this, right? Where you say I want to have a sequence from five to eight You can use things like paste zero To say measurement or something like that and then Combine that with this, right? And now when we look at why then every Row will now or every column will now have a real name. So when you when you do names Make sure that the names start with a character and that don't assign Numeric names to a matrix. That's just making your life harder than it is But row names and call names really really useful because you can use them to directly select from your matrix And also when you want to combine two matrices together When they have the similar row names, you can just merge them in one go But hey, you can you can use row names to Get the row names, but you can also use row names to assign the row names And then one of these little tricks you have the t function, which is transposing a matrix And this happens a lot Because often you have for example functions external functions, which take a matrix And then the measurements need to be in the rows and the observations or The individuals need to be in the column and the problem is your data is just the other way around So for this and this is a very common problem that your matrix is is is kind of flipped upside down, right? Or flip the other way you can use the transpose function So what the transpose function does it takes the first column and makes it the first row It takes the second column and makes it the second row and it takes the third column and makes it the third row So it flips rows and columns around and that's what the t function is for I just wanted to introduce to you because we're going to deal with it during the assignments But it's a really useful function because it happens a lot that your data is just the flipped version of what you think it should be Or what the what the external function that you are using Expects it to be right if we want to use for example principal component analysis Then the the pca function that we use Expects the rows to be individuals and expects the columns to be the different observations that you did on the individuals and Often your data is just flipped the other way. So transposing Taking row number one making it into column one taking row number two column number two and so it's just flipping it All right a little bit of a word about variables because this will come back So in my mind because I always think about code not so much as code, but it in my mind I have like a A physical picture on how things look and this is different for very for for different people Right, so in my mind if I think about a variable Then a variable is in my mind a box like a black box Right, so I can put something in the box And then I can use the box without knowing what is in it Right, so for example I always say that that variables are like boxes control structures are like conveyor belts and functions are like factories because in my mind That's just the visualization that I have with it. It might not be a useful visualization for you, but in my mind Variables are just boxes where you can put stuff in Right, so and we have already seen a lot of them So we can name a variable anything we can come up with the name so make sure that you select meaningful names So here I'm defining a variable called variables and I put the value 1.5 in Here I'm defining a variable which is called can and I'm putting two logical values in there So a vector with two logical values So variables can have many names and you are responsible for selecting correct names for them So that's that's a difficult task, but that's something that we will grow into And you can put things in boxes using this Arrow thingy, right or you can use the is symbol So is also signs into a variable. So These two things are equivalent if I say mm Five this is equivalent to nn is five, right and you can select which one of the two you want So and generally I like to use the pointy arrow thingy And why do I like the pointy arrow thingy because I can flip it around right and I can say five put five into So put five into uh, oh Right, so I can assign the other way around while the is always assigned to the to the To the beginning, right? So here I'm putting five into nn But using the arrow I can assign five to mm or I can assign five to oh the other way around And this is just one of these quirks in r And sometimes it's useful. Sometimes it's not But I always try to use the arrow All right, so very good So for the assignments because we're almost done I want you guys on your hard drive to make a new directory and the new directory will hold One script for every assignment, right? So every week create a new file So my file is called assignment one or answers one dot r And then for the second round of assignments, we have answers to dot r. So name the files in a logical way Don't call them a one a two a three a four, right? It you can It's not wrong, but just be diligent, right? Programming is like working in a lab What's a directory a file no a directory is one of these yellow folders thingies in in in in windows Let me see. I don't have a So if you go into windows and you click somewhere and you can say new and then you have the option to do a folder Or a text document or something like that Yeah, a folder. Yeah. Yeah. Yeah. So head just create somewhere on your hard drive create a folder and Or a directory. Um, that's the official name. I think And and just put everything into one, right? So then you can also at the beginning of your script use Set working directory, right? Because you have to move from where you started are To the folder where you have your Very of your answers and that's not important for the like the first Assignments because we're not going to load anything from disk or write anything to disk But once we start getting into the later assignments, then you will also have files that you need to load Right, and then you need to put those files into a data folder. Um, and then hey, you get a more complex structure So when you program, um, and let me show you notepad plus plus Always add a header a comment section at the beginning of the file So all of my files start more or less like this Where I have a hashtag and then That is windows far away. So I always have like a hashtag Another hashtag and then I have the Description of the file. So what does it do? Right? So in this case, it would be answers to assignment one Right and then add a copyright statement because you are making it. It is your code and this is important And it's yours, right? So and so claim ownership of what you are doing Generally, I have the name of the file the date the purpose of the file and then a copyright statement And use a lot of comments. So I'll have when when I think that one of the first assignments is to do Something like four plus five Like this four plus five, right? Of course, you don't have to write a comment here. Everyone knows what's happening But when stuff starts becoming more complex Explain what you do and generally what I do is the answer. I write down like this. So four plus five answer Is nine, right? And then we have the next one which can be sec one to ten Well, that's not a good one sec one to ten By two and then do the sum of this, right? And then this is my code. I go to r I copy in the code Into r Like this, right? And then it says 25. That is my answer. So I go back to notepad and then I write down Hashtag answer 25 Not 225, right? So just to keep things structured and in the beginning this seems like a lot of extra work It is a lot of extra work in the beginning But in the end it will really really benefit you One of the reasons is um, why do I do this? So and why do I Why do I hammer so much on it that I want you guys to to do it as well? is Because in the end it makes your code searchable Right windows can easily search into text files. So this is for example in an Something I wrote like a couple of years ago in 2015 So the purpose of this file is the analysis of hardy Weinberg equilibrium, right? It is copyrighted 2015 by the hau berlin because I work for the hau So all of the code that I write during the time that I'm sitting here behind my desk is not mine It's from the university, right? It is written by me And then I generally add when it was first written and when it was last modified And this is not so much for me, but this is for the person that's going to eventually replace me Because you are writing code But you're not living in a void Like you are standing on the shoulder of giants. So you have to Know who these people were you need to know when they touched the file last right when when the first version of it was written All of my scripts start with a kind of set working directory Right, so I always say at the beginning of my script I want to move to the d drive into the r-course into the assignments So this is where I store all of my answers to the assignments So this is kind of an example But be diligent about it because this will save you in the end so Use a good text editor If you are on windows, I always advise people to use notepad plus plus It is a beautiful editor Um, I love it a lot. Um, it has automatic code highlighting which I like a lot, right? So, um, if I use like sec and sum it recognizes that these are built in function in r And I get this little purplish glow, right? It knows that these are numbers So they get to be orange. It knows that this is a comment. So it it makes it green So I can directly visually see what's happening in the file um and Use an editor which has bracket testing This means that when I put my cursor behind the bracket, it highlights the corresponding one, right? So here I'm highlighting the last one and it belongs to this one Here I can highlight put it here, right and I can see okay So this bracket here Which I'm closing here was opened here, right? And if I go one further it see okay, so this one I open It uh, this one I closed it opened here, and this is really important Because when you start building up bigger and bigger scripts, um, let me see if I can find an example of something like this Um, where I am using like a massive massive amount of brackets.  Um, let me see if I can find a good good example Um, let's do an example in R um, so something goat ish For example sequencing Then no, that's not a good example Like here right here, so now I can put my cursor here and I can see oh the Curly bracket that I opened here gets closed all the way over here, right? You can directly physically see and this is very important Um, yeah the same thing for something like this. Oh, I know that the bracket because in the end A missing bracket will cause a lot of headache It will be a lot of debugging finding exactly where it is and then just being able to put Yeah, so if I would have an additional bracket right here Um, then now it will open it here And now when I can I can scroll through the file and I can see that this bracket is actually closing it here Right, so so now when I go to the first one here Then now it it doesn't highlight it meaning that this one is not closed Right, so so this one here is closed because it closes here after the paste But this one is is close or is opening and then closing the last one here But the one here in the front now has no partner So I mean I know now that I'm missing a closing bracket somewhere Um, and this is this is really important Um, so yeah It if you use windows use notepad plus plus If you are using mac os x use bb edit, which is a free editor for mac And if you're using linux, you can use whatever you want I'm super confused with these programs. Are we seeing r right now or notepad? Okay, so this is notepad plus plus And this is r So r is always everything in red at least in my version, right? And it has this r console here Right, and it has the stop button here to stop computation and um Perhaps it would be better if for notepad. I would just add my directory browser Like this But it it really depends so and in the end you can use any editor that you want Is atom good for r? Yeah, atom is a pretty fine editor as well. It it It's In the end like you can use anything you can't use microsoft word, of course I I definitely would have advised you against using notepad But notepad plus plus is a really good editor for code So yeah, joly some this is just something that is Um Is confusing at first, but once you installed both of them, um, then you can easily kind of see the difference But in r And that's why we looked at the look and feel of r also r can look very different from time to time right because this is r but This is r as well So here Let's open up the command window. So this is r as well, right? I can just type in five plus five Or five two five five plus five five plus five like this and then it will tell me ten Right. So the thing to remember if you see this, um Larger than symbol then this is an input line in r if you see something like one Then this is an output line in r. So this is an automatically index vector this vectors of length one It contains one value So it is something that you just have to kind of get used to and it can be different for all of the I think I have no, don't worry. Don't worry. That's why we're here for right? That's that's just to Just to help you kind of get familiar with all of the all of the things And like in the end every beginning is really hard Especially when you have no programming experience and for me. I also Sometimes gloss over these things too quickly. I've been programming since I was four years old So a lot of these things for me are very very logical and I don't I have for me. It's really hard to think like a beginner So if you're saying that no, can you explain it? Then I will gladly take the time to explain it Even if we're sitting here until six, right? That's why we have a four hour lecture Um had just to make sure that you guys come away with a new skill Right. I can already program. So for me, it's not it for me. It's really hard to Think back like what did I not know when I was a beginner? Um, but yeah, so Don't feel any burden to ask these kinds of questions. Um, I'm more than willing to explain And next time when we meet In person, I will send around an email about that about when we are going to do the assignments Together. I put them on Moodle. So do start already. Just download the assignments from Moodle and Start doing the assignments one by one If you get stuck either send me an email or wait until we can sit together on probably Thursday next week And then we will sit together for two hours and we will definitely go through all of these things but Will we know if the next lecture is actually in real life at Impoliti Strasse? Yeah, that's that that's still not entirely clear I'm very confused by the corona thing from the hau um Because we we have these emails with these dean stanweizung Right and the big issue was that we have dean stanweizung nine And then we had dean stanweizung 10 and nine was wearing mask and I have to check you guys If you're vaccinated and I have to make sure that if one of you gets covid that I inform everyone um, and then At a certain point they switched to 10 But 10 was not approved by the personnel Rat or personnel up tailung so that invalidated 10. So we're back to nine and it's completely unclear at least for me I I have no idea what I should do To have you guys in the building and have you formally in the building? Especially since I'm a little bit scared about it because we have two people in the building working in the lab Who have immune diseases? So they are either on immune suppressants or they are naturally immune compromised So I don't want to risk them getting sick because for them. It's a much bigger deal than for me Yeah, for me it would probably just be like a short flu or anything But that's the thing but I will inform you guys Speedily once I figured out how we can do this um All right, let me finish up the presentation. We still have like two slides left Um, Rolando Riviera. I have a question But I think it would be easy if I ask it early sure hang around in the zoom after the lecture we can just Chat about it very quickly All right, so use a good text editor So on windows, I always advise notepad plus plus if you want to use atom or you want to use visual studio code Or another kind of code editor No worries. We can just do that And you can use it as long as you feel familiar with it, right for me.  We see the same thing Written down in two different ways, right? One of them is just not adhering to Identation at all and because it's an unordered list with a list item Has so this although it takes more space It is nice and clean, right? You can you can see the structure of the code So this one is within this one and the same thing holds for are right if you if we go back to notepad head then you see also that I Take the time to lay out my code, right? So when I do a while then this is within the while loop, right? So because the the bracket starts here and ends here, right? So indentation is very important. Don't squeeze everything on one line Often you are allowed to and you can but you should not do that, right? So so make sure that things are structured in a way that just physically or looks good Right, so if you look at code and it looks clean Then it's much easier to reason about what is happening and and how it works And that's it for today So are there any questions? Wait, there's one more slide So the assignments are available on Moodle You can get them from here as well if you're Just hanging out on youtube and thinking oh, I want to learn a little bit of r So had the the assignments you can get from here. So r 2022 Those are the new assignments The lectures are in our lectures. Make sure to add the slash to the end. I wrote my own web server Should never do that should use a standard web server, but I wrote my own and I'm using it and I'm sticking with it but You need to add the slash at the end. So r 2022 without the slash is a different page Is a page not found with the slash it will show you an overview Let me show you guys how it looks just because we can do that. So let me go to firefox Let me get the firefox here. So if we go to denny arans.nl, right, then this is my home page And then if we go to r 2022, right without the slash it says Restricted you're not allowed to do this if you add the slash to the end Then you get to my home page and there's the first assignments So this is the first assignment, right? So the first thing is install r Then install the good text editor create a directory a folder on your hard drive Create a directory in this folder called assignments one, which is a little bit overkill But you don't really have to do that create a file called answers So but like make sure that you have a structure that you are comfortable with working in Again the example and then head just typing in these So all right, very good Let me see. I had a couple of words of wisdom The only way to learn coding to learn program is to sit down and code to do it You can listen to me for 40 plus hours But if you don't do the assignments You're not going to learn because I I can talk to you guys and I can explain to you all kinds of things In the end only by doing the assignments and and programming for yourself like taking your own data that you have and Applying the knowledge that you have to this Do you learn how to code? So do the assignments if you get stuck send me an email And do it quickly right if you get stuck and you're stuck with something for 30 minutes Then just send me an email. I'm generally very quick at responding to emails when I'm not on holiday So that's that's the way that it works And as a word of wisdom, this is not high school So I won't be checking if you did the assignments in the end. It is up to you to master a new skill I can only do so much. I can tell you How things work I can give you assignments so that you can practice how things work But if you don't do them, then you won't learn how to code And of course clean code. That's Good code. All right, so for me, that's everything. If there's any questions you can ask them now And Rolando had a question as well. So I will Quit the stream So I will see you guys next week and I'll send around an email informing you how we are going to do this Because I do think it would be fun to have you guys here do the assignments together And then I will do the stream And we will have a beamer so you can see me on the beamer or something like that Are we discussing the assignments next week? No, probably the week after Because the way that I'm currently thinking about it is that At before we do lecture number two, we do assignments number one together So then we will be discussing them in person. So I will show you my Answer so hey, you will you will sit there. You will do the assignments and then we will take 10 15 minutes and quickly go through them But I'm not I'm not sure how that's going to work yet So it's it's a little bit awkward since it's kind of a half digital half in person kind of semester thing So for me, I think it would be good if you guys get to sit together to do the assignments But we'll still have to figure out a way All right, Anja a more general question. What is the difference between python and r? brackets Both of them are programming language. It's just that the syntax is different So in r when you write a block of code you use the curly brackets We haven't touched the curly brackets at all yet But in python, you don't use curly brackets and in r you use curly brackets to denote Python is a different language. It has a slightly different structure But it's it's a perfectly valid language to learn as well. So More general question is there a difference between python and r? Yes and no because no, they're both programming languages They're both tutoring complete meaning that you can do the same thing in both languages It will just you will just have to tell the computer in a slightly different way what to do One of the things that r has that python does not have is the Built-in understanding of statistics python has no factor type. It does not understand that groups Are groups statistically speaking right because in in statistics you analyze differences between groups Different from numerical differences. So there is there is a fundamental difference in how these languages think about statistics But in theory anything you can do in r you can also do in python and anything you can do in python You can also do in r because both of them are tutoring complete languages So yeah But yeah, we can have a whole discussion about which one is better. Um, I don't think that any of them is better They're just different Um, my favorite programming language is actually not r. I have most experience programming in r My favorite language at the moment is actually the d programming language So you can look that up on google if you google day long um, or you just google my name with, um Day long well my forum posts come up as well And that it's a language which is very similar to c or c plus plus But it has some nice cities that I really like Which are not in r it has some very serious drawbacks as well like it also isn't a language for statistics but Yeah, but there's different languages every language has a as an advantage has a disadvantage all right any more questions i'm still here so We still have 37 minutes of questions if you guys want so I'm just glad that we got through all of it Because it's uh, it's a long lecture the first one. Um, I know this because I always try to push in the history to make you guys understand it Uh, Rolando, I can't hear you unfortunately Because I muted zoom so that otherwise you would be on youtube asking your question Why is r called r? Because it's the successor to s Which is a programming language as well So the s language is the is the language before r and r is an implementation of s That's that's that's the correct answer So Yeah, no, there's a programming language called s. It's not really a programming language It's more of a way of thinking about code. So you have s3 and s4 objects and r is the implementation of s um, it's like The language that I like most d right that is the successor to c He didn't see that one coming. No, no one sees that one coming. That's disappointing. Why what what kind of Like it was invented by a pirate Like that's why it's called r No, it's not like that Um, no, no, it's the successor to s Like d is the successor to c and c plus plus is also the successor to c Right, it's c but then better. So plus plus People have weird names when it comes to programming languages. There's a whole bunch of esoteric languages out there as well Which are programming languages that you do for fun Things like a programming language called pete based on paintings by pete mondrian Very interesting language very fun to program in But not very useful because you you use paint To make your programs so the programs are pictures and these pictures they are abstract paintings so every shape means is a kind of Instruction for the compiler So, um, yeah, if you're interested in programming languages and how these things relate to each other and stuff then definitely Go to wikipedia and search for the esoteric languages because those are really really fun. Um, there's also a Loll talk language. So that's that's all based on Loll talk, so but that's the way that it is. So good, um, any more questions i'm happy to Talk to you guys about anything And uh, if that's not the case, I have to wait 30 seconds right on youtube At least so that I know that there's no questions. I could just ask people if you have no questions and write no questions in chat that C++ is c on steroids C++ is actually c because when you write c++ You're also writing c right because c is valid c++ So a c program is also a c++ program a c++ program is not a c program So it's it's the one is a super set of the other. Um Which means that c++ inherits a lot of the baggage of of of c but Every language has its own advantages and own disadvantages Good, then thanks guys for being here staying until the end. Uh Pizza for dinner, um, I don't know. I don't know. I have to ask my moderator if we have pizza, but, uh Might be might be normally, uh, donner's talk is a pizza talk. So, uh, that uh That's kind of the rule My house Good, if there's no more questions, then Again, thanks so much for being here. Like the of course wouldn't be fun without you guys Thank you for asking questions and not being ashamed of asking questions, which you should never be Um, and I will let you know how we will do it next week and how it will work. Um, I'm definitely going to record it. Um, because With the whole covet thing if people Have to stay home or do isolation or whatever then, um, I think this is one of the ways that people can just continue following the course um, and uh With that, um, thanks so much and I will see you guys next week For sure. So I don't have a button for that I'm going to my finished screen. So Pizza tag. Yeah, thanks. Yeah. No, thank you guys for being there without you. It would not be uh, would not be as fun Good. All right, then See you on the flip side or at least next week