Excel Tutorial: Inferential Statistics © Schachman.

35
Excel Tutorial: Inferential Statistics © Schachman

Transcript of Excel Tutorial: Inferential Statistics © Schachman.

Page 1: Excel Tutorial: Inferential Statistics © Schachman.

Excel Tutorial: Inferential Statistics

© Schachman

Page 2: Excel Tutorial: Inferential Statistics © Schachman.

Let’s try some t-tests!

T-tests analyze the difference between two means. There are two types:–t-test for independent groups (between

subjects)–t-test for dependent (paired) groups

(within subjects)

Page 3: Excel Tutorial: Inferential Statistics © Schachman.

First, we will do the independent t-test

• You have designed an intervention to enhance self-esteem in recent amputees. The individuals who meet your eligibility criteria and who have agreed to be in your study (n = 10) were assigned to either the comparison group or experimental group via a coin-toss. Before you conduct your intervention, you would like to see if the two groups have any significant differences in the demographic variables (to see if there are pre-existing group differences). One of the variables we would like to compare is AGE. Follow along…..

Page 4: Excel Tutorial: Inferential Statistics © Schachman.

We need to have another column for group. “1” will be experimental, “2” will be comparison. NOTE…usually this column is added before you start entering the data, not afterward (my goof). Remember, to insert a column, you must be on the HOME tab. Have your cursor to the column to the right, click on “Insert”, then click on “Insert Sheet Columns.” Call this new column “Group”

Page 5: Excel Tutorial: Inferential Statistics © Schachman.

Code Book

Group:

1 = Experimental

2 = Comparison

It just so happens that the first 5 subjects were in the Experimental group, while the last 5 subjects were in the Comparison group……..

Page 6: Excel Tutorial: Inferential Statistics © Schachman.

Now, we are ready to analyze the data. This should look familiar…..

From the top navigational bar, click on the DATA tab, and then “Data Analysis.”

Then, click on “t-test: Two Sample Assuming Equal Variance.” (Unless you want this to get very complex, avoid “Unequal Variance.”). The PAIRED t-test is something we will use later.

1

2

Page 7: Excel Tutorial: Inferential Statistics © Schachman.

Place your cursor on the box that says “Variable 1 Range.” Then glide your cursor over the ages of the first 5 subjects (those who are in Group 1). Do NOT include the “Age” label.

Page 8: Excel Tutorial: Inferential Statistics © Schachman.

Now, time to add the data for your Comparison group. Place your cursor on the box that says “Variable 2 Range.” Then glide your cursor over the ages of the second 5 subjects (those who are in Group 2). Click OK

You are ready to click the “OK” button. Be sure the “Labels” box is NOT checked. Note that your significance level is set at 0.05. This is standard---leave it that way.

Page 9: Excel Tutorial: Inferential Statistics © Schachman.

Here are your results…..I have added the highlight so you can see the relevant areas better.

The mean age for Group 1 (experimental) is 36.8 years. The mean age for Group 2 (Comparison) is 51.6. Sample size for both groups is five (n = 5). The t- statistic is -2.806 ---do not worry about what this means. Just pay attention to the p-value for this 2-tailed test. It is 0.02. Since the p-value is less the 0.05 alpha level, this is a statistically significant difference in age between the two groups.

Page 10: Excel Tutorial: Inferential Statistics © Schachman.

What this will look like in your thesis…..

• “When subjected to an independent samples t-test, significant differences in age (p = 0.023) were found between the Experimental (χ = 36.8 years) and Comparison group (χ = 51.6 years).”

χ t p

Experimental 36.8-2.80 0.023Control 51.6

Table 1

Independent Samples t-test of AGE by Group

Page 11: Excel Tutorial: Inferential Statistics © Schachman.

Moving along……..

All 10 subjects were administered a 5-item Self-Esteem pretest. This is shown on the next slide---the numerical responses for each of the 5 SE questions have been summed together for a TotalSE score

Page 12: Excel Tutorial: Inferential Statistics © Schachman.

Now we want to see if there are any differences between the Experimental group and Comparison group on the SE pretest..

This should look familiar. Follow along……From the DATA tab, click on “Data Analysis”, select on “t-test: Two Sample Assuming Equal Variance” and click OK!

Page 13: Excel Tutorial: Inferential Statistics © Schachman.

For “Variable 1 Range”, glide your cursors over the SE scores of the Experimental Group

For “Variable 2 Range”, glide your cursors over the SE scores of the Comparison Group. Click OK!

Page 14: Excel Tutorial: Inferential Statistics © Schachman.

Here are your results…..

There are no differences between groups in SE pre-test scores. The mean for the Experimental group is 19, while the mean for the Comparison group is 19.8. With a p-value of 0.82, this is not a significant difference in SE pre-test scores.

Page 15: Excel Tutorial: Inferential Statistics © Schachman.

So, no pre-existing group difference in SE pretest scores---that is good! Now, it is time to implement your intervention to the 5 subjects in the Experimental group. The Comparison group receives no intervention. Then, all of the subjects receive a SE post-test. Your next step would be to see if there is a difference between the Experimental and Comparison group on post-test scores. If your intervention was effective, the mean post-test scores for the Experimental group should be higher than the mean score for the Comparison group. The steps to conduct this t-test are exactly the same as I have already demonstrated, so we will not go through another example.

Page 16: Excel Tutorial: Inferential Statistics © Schachman.

In the previous examples, the first 5 subjects were from the Experimental group, and the second 5 subjects were from the Comparison group---very convenient if they are already pre-sorted in this way. But what if they are not organized in that way? Say you enter data on a few of the Experimental subjects, then a Comparison subject, then a few other Experimental subjects, and so on? Then, instead of looking like the chart on the left, it looks more like the chart on the right.

You MUST get the groups in order before you analyze them. Here’s how…..

Page 17: Excel Tutorial: Inferential Statistics © Schachman.

From the HOME tab, Select the “Group” column….

Then click on “Sort & Filter, and from the drop-down selections, choose “Sort Smallest to Largest”

Page 18: Excel Tutorial: Inferential Statistics © Schachman.

You will receive a “Sort Warning” telling you that is going to re-arrange your data. Click “Sort”

Now you see that the groups are sorted. Note that the subject #s were maintained with the correct data. Very important!

1

2

Page 19: Excel Tutorial: Inferential Statistics © Schachman.

Now, we are moving on to 1-group pretest/posttest designs.

• Scenario: You have 10 diabetic subjects. You want to see if your intervention to increase Diabetes self-care knowledge was effective. All of the subjects complete a DM Knowledge pre-test, to determine their baseline knowledge level. After all 10 subjects receive the DM teaching intervention, you administer the post-test. A PAIRED (dependent) t-test is conducted to see if there are any differences from pre- to post-test. A paired (dependant) t-test is selected because you are working with ONE group, not two.

Page 20: Excel Tutorial: Inferential Statistics © Schachman.

Since we are only working with ONE group, you can either delete that column, or make them all the same number (“1” as I have done above). In this sample, I have already administered the 5-item DM knowledge pre-test and have tallied the individual scores.

Page 21: Excel Tutorial: Inferential Statistics © Schachman.

After I conduct the intervention, I administer the post-test. Normally, I would enter the scores for each of the 5 items on the post-test and then sum them to get the Total_PostDM score (post-test score)---just like I did with the pre-test. But, due to time and space constraints, I have taken a shortcut and just put in a new column with the total post-test score. I would not recommend using this shortcut in your data analysis—it is prone to math error!

Page 22: Excel Tutorial: Inferential Statistics © Schachman.

We are now ready for Data Analysis…1

2

From the DATA tab, click on “Data Analysis”

Click on “t-test: Paired Two Samples for Mean.” Click OK.

Page 23: Excel Tutorial: Inferential Statistics © Schachman.

For Variable 1 Range, glide your cursor over the Pre-test scores. You may include the label if you wish.

For Variable 2 Range, glide your cursor over the Post-test scores. If you have also included your labels, make sure that box is checked.

Page 24: Excel Tutorial: Inferential Statistics © Schachman.

Here are your results…….

Following the intervention, diabetes knowledge increased from a mean of 19.4 to 21.5 on the Diabetes Knowledge Questionnaire (p = 0.0003).

Page 25: Excel Tutorial: Inferential Statistics © Schachman.

What is this number??????

Sometimes you get results that look like this. The E-06 tacked on to the end of this means that the actual number has SIX zeros in front of it. (p = 0.000000354).

Page 26: Excel Tutorial: Inferential Statistics © Schachman.

Lastly, fun with Correlations!

• You would like to see if there is a relationship between Self Esteem and Compliance in patients with HIV. All 10 of your subjects complete three questionnaires: 1) Demographic; 2) Self Esteem; and 3) Compliance. The data entry is shown on the following slide. Remember, just to save time/room I have just entered the total Compliance score for each subject instead of each item. You will not be taking this shortcut.

Page 27: Excel Tutorial: Inferential Statistics © Schachman.

Here’s what it looks like….

Page 28: Excel Tutorial: Inferential Statistics © Schachman.

Now we begin Data Analysis….

You know the routine….From the DATA tab, click on “Data Analysis, and then select “Correlation” from the drop-down menu. Click “OK”

Page 29: Excel Tutorial: Inferential Statistics © Schachman.

For your Input Range, glide your cursor over the 2 columns that you want to examine. The difficult thing about Excel is that these columns have to be RIGHT NEXT to each other. So you may have to rearrange your columns to ensure that they are side-by-side. If you include the column labels, make sure the box “Labels in First Row” is checked.

Page 30: Excel Tutorial: Inferential Statistics © Schachman.

Here are the results!

Remember, in correlations, the closer you get to 1 or -1, the more closely the two variables are related.

A strongly positive correlation (r = 0.94) was found between self esteem and compliance in patients with HIV (n = 10). Subjects who had high levels of self esteem also reported highly compliant health-related behaviors.

Page 31: Excel Tutorial: Inferential Statistics © Schachman.

Now lets graph it! Select your two columns. Include the column labels. Go to the INSERT tab. Then click on the Chart button (green arrow).

Select Scatter Plot (this is the only logical choice for a correlation graph). Click “OK”

Page 32: Excel Tutorial: Inferential Statistics © Schachman.

This is automatically what pops up. To correctly place the titles on the axes of the graph, click on “Chart Layouts”

(first button on the left)

Page 33: Excel Tutorial: Inferential Statistics © Schachman.

Once you have clicked on “Chart Layouts” you will be able to move your cursor over

each title and type in the correct label.

Page 34: Excel Tutorial: Inferential Statistics © Schachman.

Now that the graph titles/labels are just right, I want the graph to show up on a new worksheet, rather than imbedded in the dataset, so click on “Move Chart” then name your new sheet

(here it is “Relationship Comp SE” and Clivk “OK”

Page 35: Excel Tutorial: Inferential Statistics © Schachman.

Voila!

Even though we only have 10 subjects, you can see the nice, positive, linear relationship between these two variables. As Self-Esteem increases, so does Compliance.

The End!!!