Excel Gage R&R Macro

A Gage R&R is a measurement system capability study whose purpose is to assess how much variation is associated with a measurement system and to compare it to the total process variation or tolerance.  The gage variation is divided into two main groups: Repeatability and Reproducibility, thus the name Gage R&R.  Repeatability is the variation obtained by the same person using the same instrument on the same product for repeated measurements (within operator). Reproducibility is the variation obtained due to differences in people who are taking the measurements (between operators). There are multiple software tools that would run a Gage R&R analysis including QuantumXL, Minitab, JMP, MATLAB, R, and many others. However, it has been my experience that often engineers do not feel comfortable with the results due to a lack of clarity on how the variance components were computed. While it is possible to perform a Gage R&R in a tool as simple as Excel using ANOVA, these calculations are numerous and tedious. It is for this reason that I created an Excel Gage R&R Macro, which does not only compute the variance components but also shows the math used to compute them within the excel file. These calculations can be used by engineers to get more familiar with the variance component calculations.



This link will take you to my personal one drive where you can download the file "Anova_GageR&R_Rev0"

Is VTSAX really cheaper on Mondays?

On my last blog post I looked at which day of the week is better to buy VTSAX over time. On that post I showed that over the time period ranging from 11/13/2000 thru 10/5/2018, the median price difference between the daily price and the weekly average was the lowest on Monday. The plot showing this result is once again shared below


Box Plot for daily price difference from weekly average:

Difference From Weekly

Since this post, I have received a few comments asking if the difference is “really real” meaning is this difference statistically significant? One way to answer this question is through hypothesis testing. For those asking a similar question, I decided to share my findings here: Looking at the price variation from the weekly average, the Kruskal-Wallis test rejects the null hypothesis that all days come from the same distribution at a 1% significance level. The Wilcoxon rank sum test also rejects the null hypothesis of equal medians at the 1% significance level between Monday and any other day except for Tuesday. So basically, I would say yes, this difference is statistically significant. Now, while these results help answer this question, I am more of a graphical person. Therefore, I decided to plot the 95% confidence intervals for the median daily price deviation from weekly average. This plot is shown below with blue circles indicating the Median Value and Red Circles indicading the +/- 95% Confidence Intervals (CI). Once again, since the Monday CI does not overlap with the CI of any of the other days except Tuesday, I would say that this difference is significant. Even with Tuesday, the tails of the CI are just barely overlaping.


+/- 95% Confidence Intervals for Median Daily Price Difference:

Median_CI_Posting2

By the way, I have decided the use the median and not the mean here since there are a number of outliers in the data, as seen on the box plot above. The median value would be less affected by these points.

Best Day of the Week to Buy VTSAX

If you are into low cost index investing, you have probably heard and are buying the Vanguard Total Stock Market Index Fund, particularly VTSAX. One of the great tools that Vanguard offers is free recurring automatic investment. Using this tool, one can automatically buy VTSAX at any desired frequency such as weekly, bi-weekly, monthly and so on. Just let Vanguard know the day of the week you want to purchase and the frequency. This particular process led me to ask the following question: Which day of the week is the best day to buy VTSAX? Assuming we define the best day to buy as the day of the week on which the VTSAX closing price is lowest, we can take a look at past data to answer this question. To do this, I downloaded the VTSAX price history from 11/13/2000 up to 10/5/2018 from Yahoo Finance. Using this historical dataset, I looked at 1) the closing price distribution per day of the week and 2) the price difference between the daily closing price and the weekly average price per day of the week. Using this data, one can easily see (plots are shown below) that Monday is the day of the week with the lowest median closing price as well as the largest negative closing price difference from weekly average. This result may or may not come as a surprise since on average, the market always goes up. Therefore, one would expect the Monday closing price to be, on average, lower than the Friday closing price. However, it is great to be able to confirm this using past price data. In addition to looking at the data over the time period mentioned above, I also took a look at the data over the last ~5 years. The results are the same and indicate that if you are doing recurring automatic investment, you probably want to buy on Mondays. Please feel free to take a look at the results below.

Here are the plots for the entire time period:

Daily Closing Price

Difference From Weekly

RainCloudAll

Here are the plots for the last ~5 years starting in Jan 2013:

Daily Closing Price2013

Difference From Weekly 2013

RainCloud2013

Disclaimer: All investments involve risk. Past performance doesn’t guarantee future results. Use the material contained here at your own risk.

RainCloud Matlab Source: https://git.fmrib.ox.ac.uk/marshall/public/tree/master/raincloud_plots

Remembering DOE Resolution

Engineering often relies on Design of Experiments (DOE) to effectively understand significant dependencies of different input or control parameters to a desire measurable outcome. It is critical to properly design your experiments in a way that maximizes your ability to distinguish between the impact or contribution that each input variable has on your outcome. Different types of DOE designs have different resolutions. As stated here, a DOE resolution describes the degree to which main effects are confounded with 2-level interactions, 3-level interactions and so on. For example, in a resolution III design main effects are confounded with 2-level interactions. Ideally, we would like to have the highest resolution possible DOE. Full factorial designs have no confounding and thus are considered resolution “infinity”. However, having full factorial designs is often not possible due to the very large number of runs required. As a result, I often end up working with different resolution DOEs and often I need to remember which factors are confounded. For this, I always use a hand trick that was thought to me during my Design for Lean Six Sigma Training. I wanted to share this hand trick for those looking to remember this. However, rather than explaining it, I put together the following picture:

DOE_hand_trick

The nice thing about this trick is that it also holds true when you are dealing with say resolution VI or greater DOE. For DOE resolutions higher than V, just use your two hands, and work with the number of fingers equal to the DOE resolution as indicated above.