06.09.2021 Views

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

Learning Statistics with R - A tutorial for psychology students and other beginners, 2018a

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

- correction <strong>for</strong> multiple testing: holm<br />

dan.sleep baby.sleep dan.grump day<br />

dan.sleep . 0.000 0.000 0.990<br />

baby.sleep 0.000 . 0.000 0.990<br />

dan.grump 0.000 0.000 . 0.990<br />

day 0.990 0.990 0.990 .<br />

SAMPLE SIZES<br />

============<br />

dan.sleep baby.sleep dan.grump day<br />

dan.sleep 100 100 100 100<br />

baby.sleep 100 100 100 100<br />

dan.grump 100 100 100 100<br />

day 100 100 100 100<br />

The output here contains three matrices. First it prints out the correlation matrix. Second it prints<br />

out a matrix of p-values, using the Holm method 6 to correct <strong>for</strong> multiple comparisons. Finally, it prints<br />

out a matrix indicating the sample size (number of pairwise complete cases) that contributed to each<br />

correlation.<br />

So there you have it. If you really desperately want to do pairwise hypothesis tests on your correlations,<br />

the correlate() function will let you do it. But please, please be careful. I can’t count the number of<br />

times I’ve had a student panicking in my office because they’ve run these pairwise correlation tests, <strong>and</strong><br />

they get one or two significant results that don’t make any sense. For some reason, the moment people<br />

see those little significance stars appear, they feel compelled to throw away all common sense <strong>and</strong> assume<br />

that the results must correspond to something real that requires an explanation. In most such cases, my<br />

experience has been that the right answer is “it’s a Type I error”.<br />

15.7<br />

Regarding regression coefficients<br />

Be<strong>for</strong>e moving on to discuss the assumptions underlying linear regression <strong>and</strong> what you can do to check if<br />

they’re being met, there’s two more topics I want to briefly discuss, both of which relate to the regression<br />

coefficients. The first thing to talk about is calculating confidence intervals <strong>for</strong> the coefficients; after that,<br />

I’ll discuss the somewhat murky question of how to determine which of predictor is most important.<br />

15.7.1 Confidence intervals <strong>for</strong> the coefficients<br />

Like any population parameter, the regression coefficients b cannot be estimated <strong>with</strong> complete precision<br />

from a sample of data; that’s part of why we need hypothesis tests. Given this, it’s quite useful to be able<br />

to report confidence intervals that capture our uncertainty about the true value of b. This is especially<br />

useful when the research question focuses heavily on an attempt to find out how strongly variable X<br />

is related to variable Y , since in those situations the interest is primarily in the regression weight b.<br />

6 You can change the kind of correction it applies by specifying the p.adjust.method argument.<br />

- 472 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!