Tuesday, November 18, 2008

How to use ANOVA tools in Excel


Many functions require the calculation of the sum of squared deviations about a mean. To do this accurately, Microsoft Office Excel 2003 and later versions of Excel use a two-pass procedure that finds the mean on the first pass, and then calculates squared deviations about the mean on the second pass.

In precise arithmetic, the same result occurs in earlier versions of Excel that use the "calculator formula." This formula is so named because it was in widespread use when statisticians used calculators instead of computers. With the calculator formula, earlier versions of Excel sum the squares of the observations, and then subtract from this total the following quantity:

((sum of observations)^2) / number of observations

This calculation occurs in a single pass through the data.

In finite precision arithmetic, the calculator formula is subject to roundoff errors in extreme cases. Excel 2002 and earlier versions of Excel use the calculator formula for most functions that require a sum of squared deviations about a mean (such as VAR, STDEV, SLOPE, and PEARSON). However, these versions of Excel also use the more numerically robust two-pass procedure for the CORREL, COVAR, and DEVSQ functions.

Experts in statistical computing recommend that you do not use the calculator formula. The calculator formula is presented as "how not to do it" in texts about statistical computing. Unfortunately, all three of the Analysis ToolPak (ATP) ANOVA tools make widespread use of the calculator formula or an equivalent single-pass approach in Excel 2002 and in earlier versions of Excel.

Excel 2003 and later versions of Excel use the two-pass procedure for all three ATP ANOVA models. This article discusses the following computational improvements in ATP's three ANOVA models:
• Single Factor
• Two-Factor with Replication
• Two-Factor without Replication

Single Factor
A simple example with data is as follows.
ANOVA 1 BASIC MODEL:
1 2 3
2 4 4
3 6 5
4 8 6
5 --7
6 --8
Anova: Single Factor

SUMMARY
Groups Count Sum Average Variance
Column 1 6 ---21 --- 3.5 ----- 3.5
Column 2 4 --- 20 --- 5 ------- 6.666667
Column 3 6 --- 33 --- 5.5 ----- 3.5


ANOVA
Source of Variation SS df MS ----F --------P-value F crit
Between Groups 12.75 2 6.375 1.506818 0.257897 3.805567
Within Groups 55 13 4.230769

Total 67.75 15
Excel 2002 and earlier versions of Excel use the following pseudocode to calculate the sums of squares:

GrandSum = 0;
GrandSumOfSqs = 0;
GrandSampleMeanSqrd = 0;
GrandMeanSqrd = 0;
GrandSampleSize = 0;

For s = 1 to Number_of_Samples do
GrandSum = GrandSum + sum of observations in s-th sample;
GrandSumOfSqs = GrandSumOfSqs + sum of squared observations in s-th sample;
GrandSampleMeanSqrd = GrandSampleMeanSqrd +
(sum of observations in s-th sample^2)/size of s-th sample;
GrandSampleSize = GrandSampleSize + size of s-th sample
Endfor;

GrandMeanSqrd = (GrandSum^2) / GrandSampleSize;

TotalSS = GrandSumOfSqs – GrandMeanSqrd;
BetweenGroupsSS = GrandSampleMeanSqrd – GrandMeanSqrd;
WithinGroupsSS = GrandSumOfSqs – GrandSampleMeanSqrd;

This approach is essentially the calculator formula. This approach computes the sums of squares of observations, and then subtracts a quantity from them, just as VAR computes the sum of squares of the observations, and then subtracts sum of observations^2/sample size. Similar pseudocode for the model 2 and model 3 has been omitted.

Again, for model 2 and model 3, sums of squares are calculated and a quantity is subtracted from the sum of squares as in the calculator formula. Unfortunately, basic statistics texts frequently suggest approaches for ANOVA such as the one that is shown earlier in this article.

Excel 2003 and later versions of Excel use a different approach to calculate the various entries in the SS column of the ANOVA table. For illustration, this article assumes that the numeric data in the earlier example appear in cells A2:C7 with missing data in cells B6 and B7.
• Total SS is just DEVSQ applied to all the data, such as DEVSQ(A2:C7). DEVSQ works correctly even though data is missing.
• Between Groups SS is Total SS minus the sum of DEVSQ applied to each column, such as DEVSQ(A2:A7) + DEVSQ(B2:B7) + DEVSQ(C2:C7).
• Within Groups SS is Total SS minus Between Groups SS.

Wednesday, November 12, 2008

#VALUE error when you add text and values in Excel

In Microsoft Excel, when you perform a mathematical operation on cells that contain text and values, you may receive a #VALUE! error. In this post i will given some idea for Microsoft Excel Support to slove that type of problems.

Although some functions correctly evaluate cells and ignore text strings, if you add the cells by using arithmetic operators such as addition (+), subtraction (-), multiplication (*), or division (/), an error value may occur.

Do the following for Resolution

Instead of using an individual mathematical operator, use its equivalent worksheet function instead:
SUM (adds)
PRODUCT (multiplies)
QUOTIENT (divides)
For example, if you type the following information in cells A1:A7 of a worksheet

A1: 10
A2: text
A3: 20
A4: =A1+A2+A3
A5: =SUM(A1+A2+A3)
A6: =SUM(A1,A2,A3)
A7: =SUM(A1:A3)


the formulas in cells A4 and A5 return a #VALUE! error; however, cells A6 and A7 return the correct value of 30.

Friday, November 7, 2008

How to use startup folders in Excel

Folders that Excel uses at startup
If you install Excel in the default location, Excel opens files from the following paths:
• In Microsoft Office Excel 2003, the path is C:\Program Files\Microsoft Office\Office11\Xlstart

In Microsoft Office Excel 2007, the path is C:\Program Files\Microsoft Office\Office12\Xlstart
• C:\Documents and Settings\User_name\Application Data\Microsoft\Excel\XLSTART

In this path, User_name is your logon user name.
• The folder that is specified in the At startup, open all files in box

Note
To find the At startup, open all files in box in Excel 2003, click Options on the Tools menu, and then click the General tab.

To find the At startup, open all files in box in Excel 2007, click the Microsoft Office Button, click Excel Options, and then click Advanced. The At startup, open all files in box is under General.

Accepted file types during Excel startup

You typically use startup folders to load Excel templates and add-ins. You can also use startup folders to load workbooks. When you load the following types of files from a startup folder, the files have the important characteristics that are described in the following list.
Templates
If you save a workbook named Book.xlt, and then put it in a startup folder location, that workbook is the default workbook when you start Excel or open a new workbook.

To use additional templates, you must save them in the following folder:
C:\Program Files\Microsoft Office\Templates\1033
To use the templates in Excel 2003, follow these steps:
1. On the File menu, click New.
2. In the New Workbook task pane, click On my computer under Templates.
3. In the Templates dialog box, double-click the template for the type of workbook that you want to create on the Spreadsheet Solutions tab.

To use the templates in Excel 2007, follow these steps:
1. Click the Microsoft Office Button, and then click New.
2. Under Templates, click Installed Templates.
3. Under Installed Templates, click the template that you want, and then click Create.
Add-ins
Add-ins (.xla files) that you put in a startup folder do not typically appear when you start Excel. The add-ins are loaded in memory. The add-ins run any auto macros.

You can use these add-ins by whatever method the add-in provides (for example, a command on a menu or a button on a toolbar).
Workbooks
Workbooks (.xls files) that you put in a startup folder are loaded and appear when you start Excel, unless the workbook is saved in a hidden state.

Tuesday, November 4, 2008

New Field button is unavailable in Show Field dialog boxes in Outlook

When you use the Field Chooser or Show Fields options in Microsoft Outlook, the resulting dialog boxes may display the New Field button as dimmed (unavailable), or if available, when you click the New Field button, you may receive the following message:
You do not have permission to add a custom field to the folder. Any field you create will appear only in the current view.

To fix this Outlook problem we have to care on You can only create MAPI folder to which you have sufficient privileges.

How to Access Show Field Option

To access the Show Fields option, on the View menu, point to Current View, point to Customize Current View, and then click Fields.

Note In Outlook 2003, on the View menu, point to Arrange By, point to Current View, click Customize Current View, and then click Fields.

The New Field button is not available for one of the following reasons:

- The current folder is a file system folder. For example, if the folder banner shows that the active folder is My Documents, then the New Field button will be unavailable.

- You do not have sufficient permissions to the selected MAPI folder. If the current folder is a MAPI folder, such as a public folder, you must have sufficient permissions to that folder to allow the creation of fields. Have the folder owner ensure create permission is available to you for the active folder. The folder owner, or another user with sufficient permissions, can access the permission settings for the folder by right-clicking the folder in the Outlook Bar or Folder List, and then clicking Properties on the shortcut menu.

To validate that the New Field button is working properly, follow these steps:

1. Select the Inbox or another MAPI folder to which you know you have sufficient permissions.
2. Right-click a column header and click Field Chooser on the shortcut menu.
3. Confirm that the New Field button is available by clicking the button