Week 36: The Point-Biserial Correlation Coefficient

Today we’re going to talk about another measure of association: the point-biserial correlation coefficient!

When Would You Use It?
The point-biserial correlation coefficient is a parametric test used to determine, in the population, if the correlation between values on two variables some value other than zero. More specifically, it is used to determine if there is a significant linear relationship between the two variables.

What Type of Data?
The point-biserial correlation coefficient requires one variable to be expressed as interval or ratio data and the other variable to be represented by a dichotomous nominal or categorical scale. The point-biserial correlation coefficient is a special case of the Pearson product-moment correlation coefficient requires interval or ratio data.

Test Assumptions

  • The sample has been randomly selected from the population it represents.
  • The dichonomous variable is not based on an underlying continuous interval or ratio distribution.

Test Process
Step 1: Formulate the null and alternative hypotheses. The null hypothesis claims that in the population, the correlation between the scores on variable X and variable Y is equal to zero. The alternative hypothesis claims otherwise (that the correlation is less than, greater than, or simply not equal to zero.)

Step 2: Compute the test statistic, a t-value. To do so, the actual correlation coefficient, rpb, must be calculated first. This calculation is as follows:

09-04-2016-a

To compute the t-statistic, the following equation is used:

09-04-2016-b

Step 3: Obtain the p-value associated with the calculated t-score. The p-value indicates the probability of observing a correlation as extreme or more extreme than the observed sample correlation, under the assumption that the null hypothesis is true.

Step 4: Determine the conclusion. If the p-value is larger than the prespecified α-level, fail to reject the null hypothesis (that is, retain the claim that the correlation in the population is zero). If the p-value is smaller than the prespecified α-level, reject the null hypothesis in favor of the alternative.

Example
Let’s look at my music data again! I want to see if there is a significant correlation between the number of times I’ve played a song and whether or not it is a “favorite” (i.e., has 3+ stars). I suspect, of course, that I play my favorite songs more often than my non-favorite ones. If I code “favorite” as 1 and “non-favorite” as 0, then I will expect a positive correlation. I took a sample of n = 100 songs and let α = 0.05.

H0: ρpb = 0
Ha: ρpb > 0

Computations:

09-04-2016-c

Since our calculated p-value is smaller than our α-level, we reject H0 and conclude that the correlation in the population is significantly greater than zero.

Example in R
x=read.table('clipboard', header=T)
attach(x)
cor.test(favorite, playcount, alternative="greater")
        Pearson's product-moment correlation
data:  favorite and playcount
t = 3.1048, df = 98, p-value = 0.001245
alternative hypothesis: true correlation is greater than 0
95 percent confidence interval:
 0.1407541 1.0000000
sample estimates:
     cor
0.299258

 

CABIN FEVER

Nate and I spent today down in southern BC where I met his grandparents on his dad’s side and then got to see his mom and dad’s cabin. His dad made a fire and we roasted hot dogs. They tasted freaking fantastic (I hadn’t had campfire hot dogs—or any hot dogs, for that matter—since probably 2004). Then Nate and I went down to the lake to look at the stars (and tried not to freeze to death). It was so clear and free of light pollution out there that we could see the Milky Way.

Edit: we also tried out his parents’ kayaks on Sunday morning and have concluded that we need to get ourselves a pair of kayaks to take with us to the Parks and whatnot.

Clefairy Party!

I am 8000% obsessed with Clefairy now. I have no idea why it wasn’t my favorite Pokemon back when I was into the cards, but holy hell, it’s the cutest little thing to me now.

On YouTube yesterday afternoon, I happened to find “Clefairy and the Moon Stone,” the episode of the Pokemon cartoon where Clefairy first appeared (I’d watched several episodes that had been uploaded, so this one was on my “recommended” list on YouTube).

LOOK AT HOW ADORABLE THESE THINGS ARE SERIOUSLY

09-02-2016-a

09-02-2016-b

09-02-2016-c

09-02-2016-d

 

Also, I ordered a Clefairy plushie. Because I needed one.

The end.

New office

I moved offices today! I got “promoted” to the fifth floor where all the professors/post docs are. I met the lady who will be taking over my desk in my old office (she’s from Russia and is in the theoretical math area) while I was cleaning out all my crap. She’s super nice and said she wants to come to my lectures so she can refresh her stats, haha.

Here’s a pic of my new office:

09-01-2016

I’m sharing it with two post-docs, but one of them isn’t teaching this semester and spends most of his time at Foothills, so he probably won’t be around. The other teaches a math class. Calculus, maybe? I can’t remember.

Anyway, the windows are west-facing, so we’ll get the hot afternoon sun, but there’s no way this office can be hotter than my previous one. That thing was a furnace.

 

Protected: FORUM

This content is password protected. To view it please enter your password below:

I really suck at titles, sorry

Pokemon Go is dying, you say?

Behold, Prince Island Park!

08-30-2016-a

08-30-2016-b

These pictures were taken last Sunday, not today, but still. Lots of people. 99% of them playing Pokemon Go. While I was setting my first lure module on a Pokestop, Nate and I saw a bunch of people sprinting over to a certain area of the park. Turns out there was a Nidoking there. Later, a bunch of people went sprinting off in search of an Omanyte.

This game is fantastic.

SPEAKING OF POKEMON GO…

Here’s a calculator that estimates how long it will take you to get to level 40. It does so by taking your current amassed XP and dividing it by the number of days you’ve been playing to find your average daily XP gain. Then it calculates how many days it will take you to reach the 20,000,000 XP needed for level 40, assuming you continue to gain your average XP every day.

Here’s mine, by the way:

08-30-2016-c

Ouch.

Well, Niantic certainly built this game to last, haha. Look at that bar at the bottom, showing the “distances” between levels. Here’s a plot I made to further illustrate it:

08-30-2016-d

The amount of XP needed to go from level 39 to level 40 is more than the amount of XP needed to go from level 1 to level 34. That’s awesome.

Ploop

The sky was doing some weird stuff this evening, so have some crappy “Claudia’s not a photographer” pictures of it.

08-29-2016-a

08-29-2016-b

08-29-2016-c

Week 35: The Pearson Product-Moment Correlation Coefficient

Today we’re going to talk about our first measure of association: the Pearson product-moment correlation coefficient!

When Would You Use It?
The Pearson product-moment correlation coefficient is a parametric test used to determine, in the population, if the correlation between values on two variables some value other than zero. More specifically, it is used to determine if there is a significant linear relationship between the two variables.

What Type of Data?
Pearson product-moment correlation coefficient requires interval or ratio data.

Test Assumptions

  • The sample has been randomly selected from the population it represents.
  • The variables are interval or ratio in nature.
  • The two variables have a bivariate normal distribution.
  • The assumption of homoscedasticity is met.
  • The residuals are independent of one another.

Test Process
Step 1: Formulate the null and alternative hypotheses. The null hypothesis claims that in the population, the correlation between the scores on variable X and variable Y is equal to zero. The alternative hypothesis claims otherwise (that the correlation is less than, greater than, or simply not equal to zero.)

Step 2: Compute the test statistic, a t-value. To do so, the actual correlation coefficient, r, must be calculated first. This calculation is as follows:

08-28-2016-a

To compute the t-statistic, the following equation is used:

08-28-2016-b

Step 3: Obtain the p-value associated with the calculated t-score. The p-value indicates the probability of observing a correlation as extreme or more extreme than the observed sample correlation, under the assumption that the null hypothesis is true.

Step 4: Determine the conclusion. If the p-value is larger than the prespecified α-level, fail to reject the null hypothesis (that is, retain the claim that the correlation in the population is zero). If the p-value is smaller than the prespecified α-level, reject the null hypothesis in favor of the alternative.

Example
I’m going to look at my music data again! I want to see if there is a significant correlation between the length of a song and the number of times I’ve played it. I suspect that I play longer songs less often than shorter ones (I just have a preference for slightly shorter songs, not sure why), so I’m going to guess that there’s a negative correlation. I took a sample of n = 100 songs and let α = 0.05.

H0: ρ = 0
Ha: ρ < 0

Computations:

08-28-2016-c

Since our calculated p-value is larger than our α-level, we fail to reject H0 and conclude that the correlation in the population is not significantly smaller than zero.

Example in R
x=read.table('clipboard', header=T)
attach(x)
cor.test(length, playcount, alternative = "less")
        Pearson's product-moment correlation
data:  length and playcount
t = -1.0232, df = 98, p-value = 0.1544
alternative hypothesis: true correlation is less than 0
95 percent confidence interval:
 -1.00000000  0.06374622
sample estimates:
       cor
-0.102812

Have a Tumblr survey, you nerds.

Name: Claudia

Nickname: Dr. Poopenstein

Height: I DON’T HAVE TO ANSWER YOUR STUPID QUESTIONS

Star sign: Aquarius

Hogwarts house: I have no idea.

Favourite color: Orange

Time right now: 0:09

Lucky number: 11

Average hours of sleep: What is this “sleep” you speak of?

Last thing I googled:  “Anytime Fitness Calgary.” The weather’s going to be garbage soon and I want a gym I can go to when it’s -40 outside but I still want to exercise.

Favorite fictional characters: Captain Queeg (The Caine Mutiny) and Gordon Freeman (Half Life) are the two I’m thinking of right now.

Number of blankets you sleep with: Two + sheet.

Dream trip: Either Antarctica or Hanover. I’d probably pick Hanover because traveling there would be easier and involve more Leibniz obsessing, whereas traveling to Antarctica would be more difficult and cause more damage to the fragile ecosystem down there.

What do you post: On Tumblr? Pokemon Go stuff, sun .gifs, cloud pictures, math stuff, stats stuff, Leibniz stuff, Achievement Hunter stuff.

Most active followers: No one follows me. ‘Tis lonely on Tumblr, it is.

When did your blog reach its peak: When I posted this freaking thing. It still gets notes. What is wrong with people?

What made you get a tumblr: Achievement Hunter. It’s where I discovered them, after all.

Do you get asks on a daily basis: HA.

Why did you choose your URL: “Nailpit” is my old go-to name for gaming, internets, etc. I came up with it when I was 7.

Gender: Female.

Favourite music artist: Picking just one is impossible. But right now I’m especially digging WALK THE MOON.

Song stuck in your head: None right now, surprisingly.

Last movie watched: I can’t remember.

Last tv show watched: Fringe.

What are you wearing right now: Tank top and pajama pants. Stylin’.

When did you create your blog: 2012.

Do you have any other blogs: YOU’RE READING IT!

Pokemon team: Instinct.

Dream job: Statistics teacher.

Following: 49 blogs. Mostly math- and stats-related.

 

Another Anniversary

Today is August 26, 2016.

My first day at the University of Idaho was August 26, 2006.

Today marks 10 years since I started my post-secondary education. If you’d asked me in 2006 what I thought I’d be doing in 10 years, I certainly wouldn’t have answered, “just finishing up school!” Hell, when I first started college, my goal was to get out as fast as possible. Grad school? Sounded like a waste of time. Why would I want to spend more time in school?

That was the plan: get out as fast as possible. And while I usually hate it when things don’t go according to plan, I am actually quite happy with how my educational path has carved its way through the past 10 years. I mean, I’ve gotten five degrees in a decade. That’s not too shabby.

  • 2008: B.S., psychology
  • 2009: B.S., philosophy
  • 2011: M.A., psychology
  • 2014: B.S., mathematics
  • 2016: M.S., statistics

I also like how each one of these degrees has had some part in making me realize what I really, really enjoy and want to do with my life (teaching stats). No part of the past decade of education was wasted (except for maybe that business calculus class. Screw that class, man). That’s a good feeling.

ALSO, I have zero debt. Zero. This is because of my parents. My dad paid for everything for my first round of undergrad (3 years), then let me stay at his place rent-free during my second round of undergrad (2 years). My mom has paid for all my moving-around-the-continent costs and let me live rent-free with her in Arizona while I worked to save up money to eventually go back to school. That’s pretty amazing. Thanks, mom and dad.

So yeah. I figured a post acknowledging 10 years of college/grad school was needed, because 10 years is a long damn time to be doing anything.

Yay!

PONCHO PARTY 2016

GUYS

LOOK AT THIS THING I FOUND AT GOODWILL

08-25-2016

(Ignore my fugly reflection and look at the colors.)

It’s made of towel fabric and is super warm. And it’s mine now. It won’t fit in my suitcase so I’ll have to have my mom ship it up here, but I’ll have it before COLD HARSH CANADIAN WINTER™ sets in up here.

That’s all I’ve got today, sorry.

Annabelle

I have some bad news, y’all.

My sweet little Annabelle had a stroke and isn’t doing too well right now.

Peter called my mom and told her that they were taking her to the vet the other day because she was walking funny and acting strange, and it sounds like the cause of that was a stroke, not something simpler/treatable like a thyroid issue as we were originally hoping.

So I’m not sure how much longer she’s got, and it’s making me so, so sad. I’ve just spent the past hour or so crying.

Poor little thing. Send her good thoughts, huh?

d,jdkfjsdlkjfs

1. Do you like blue cheese?
I like most types of cheese. Blue cheese is not one of those types.

2. Have you ever smoked cigarettes? If yes, how did you quit?
Nope! I’ve never had the desire to. It seems pretty gross.

3. Do you own a gun? How are your feelings about gun control/2nd Amendment rights?
I do not own a gun, no. I don’t really want to, though I’ve always thought shooting (like at a range or skeet shooting or whatnot) would be a pretty cool hobby. BUT. I don’t know what the US is doing wrong as far as gun control goes, but it’s very obvious that they’re doing SOMETHING wrong. It needs to be fixed, and it needs to be fixed fast.

4. What is your favorite flavor of water?
Um…water-flavored? I HATE flavored water. A few weeks ago, I was on mile 15 of a walk and was SUPER thirsty. I went to a Safeway and grabbed the first normal-looking bottle of water I could, bought it, and went back outside. Without looking at the label, I opened it and took a big drink. Turns out it was grape-flavored water. Almost puked. Thirst was not quenched. Rage was fueled.

5. Do you get nervous before a doctor visit? Why?
I used to. But I don’t go to the doctor anymore, ‘cause they’re all hacks. Unless my illness/injury is at its absolute maximum severity, I can handle it on my own. Doctors can suck it.

6. How do you like your hot dogs?
Cooked, in a bun, and covered in a lot of ketchup. Simple.

7. Although it’s been asked a lot, tell us about a favorite movie that you haven’t shared before.
My favorite movies is Sunshine. But a movie I enjoy that I’ve been thinking a lot about lately is The Music Man. It’s fantastic. See?

8. What do you prefer to drink in the morning?
I’m not usually thirsty in the morning. Though if I am, I want water.

9. In a dating situation, have you ever misrepresented yourself to seem cooler or hipper? (Yes we know for most of you it was long ago…)
CAN’T GET HIPPER THAN ME, BRO!

10. What’s your favorite piece of jewelry? Why?
My engagement and wedding rings. For obvious reasons.

11. Favorite hobby? Tell us about it so we understand it.
I actually don’t have a lot of what you would consider “hobbies.” I have a lot of things I like, but they don’t really translate into actual hobbies. Unless looking stuff up about [insert interest here] is a hobby. Then I have plenty.
But as far as traditional, non-debatable hobbies go, I’d say drawing is my favorite. It’s very tedious, and thus very relaxing.

12. Do you have A.D.D., or have you suspected it?
Nope. Never expected it, either. And I honestly think that’s overdiagnosed nowadays, anyway.

13. What’s a thing you dislike or would change about yourself?
I do not have enough time to list everything I dislike/would want to change about myself right now. There’s a lot of it.

14. Middle name? Like it or not?
My middle name is the most common female middle name in the US (Marie). It goes well with my first and last names, but I’d be okay with a more unique one.

15. Name three random thoughts you might have on this week:
*stressed screeching* (it counts as a thought)
I’m happy to see my mom, but I miss Nate.
I NEED MORE WALKING MILES!

16. Name 3 drinks you regularly drink. Tell us a bit about them.
Um…I basically just drink water. So…water, water, and water. Not sure what else to say.

17. Current worry:
DON’T GET ME STARTED

18. Current annoyance:
DON’T GET ME STARTED

19. Favorite place to be in the summer? Give us a wee bit more than “the beach”.
Out walking. Anywhere. I like summer in Moscow because all the students are gone, but I’m enjoying walking in Calgary during the summer too, especially now that I’ve found the River Walk. It’s even better when it’s not storming.

20. How do you usually ring in the new year?
Crying.

21. What have you done this summer that’s special? Pictures please.
I ruined our planned vacation for this summer, ‘cause I’m just that special. So no pictures of that. Sorry.

22. Have you ever walked into a room with just shoes on?
Um…yes. Yes I have.

GUN IT!

Beat this walking speed, bitches:

08-22-2016-a

This was Pullman and back, so I didn’t have to worry about stopping at crosswalks/stop lights except in Moscow, so that helped.

That’s a 12.27-minute mile, by the way. Not too shabby. Too bad I don’t walk that fast all the time.

 

Edit: ow, my quads.

Week 34: The Within-Subjects Factorial Analysis of Variance

Today we’re going to look at a test similar to the one we looked at two weeks ago. Specifically, we’re going to look at the within-subjects factorial analysis of variance!

When Would You Use It?
The within-subjects factorial analysis of variance is a parametric test used in cases where a researcher has a factorial design with two* factors, A and B, and has a set of subjects that are measured on each of the levels of all of the factors. The researcher is interested in the following:

  1. In terms of factor A, in the set of p dependent samples (p ≥ 2), do the factor levels effect the variable of interest across the dependent samples?
  2. In terms of factor B, in the set of q dependent samples (q ≥ 2), do the factor levels effect the variable of interest across the dependent samples?
  3. Is there a significant interaction between the two factors?

What Type of Data?
The within-subjects factorial analysis of variance requires interval or ratio data.

Test Assumptions

  • Each sample of subjects has been randomly chosen from the population it represents.
  • For each sample, the distribution of the data in the underlying population is normal.
  • The variances of the k underlying populations are equal (homogeneity of variances).

Test Process
Step 1: Formulate the null and alternative hypotheses. For factor A, the null hypothesis is the claim that the mean of the subjects’ scores across the different levels are equal. The alternative hypothesis claims otherwise. For factor B, the null hypothesis is the claim that the mean of the subjects’ scores across the different levels are equal. The alternative hypothesis claims otherwise. For the interaction, the null hypothesis claims that there is no interaction between factor A and factor B. The alternative claims otherwise.

Step 2: Compute the test statistics for the three hypothesis. To do so, we must find SSA, SSB, and SSAB. First, find the following values:

08-21-2016-a

Then, find the SS values as follows:

08-21-2016-b

Then find the MS values:

08-21-2016-c

Finally, compute the three test statistics, F-values, for factor A, factor B, and the interaction.

08-21-2016-d

Step 3: Obtain the p-value associated with the calculated F statistics. The p-value indicates the probability of the ratio of the MSA, MSB, or MSAB to MSWG equal to or larger than the observed ratio in the F statistics, under the assumption that the null hypotheses are true.

Step 4: Determine the conclusion. If the p-value is larger than the prespecified α-level (or the calculated F statistic is larger than the critical F value), fail to reject the null hypothesis (that is, retain the claim that the population means are all equal). If the p-value is smaller than the prespecified α-level, reject the null hypothesis in favor of the alternative.

Example
I don’t have a good example of my own for a within-subjects factorial analysis of variance, so I figured I’d use the example from the book! An experimenter employs a two-factor within-subjects design to determine the effects of humidity (factor A, two levels) and temperature (factor B, three levels) on mechanical problem-solving ability.

Here, n = 18 (three subjects across 2 x 3 different conditions) and let α = 0.05.

H0: µlowhumidity = µhighhumidity
Ha: the means are different

H0: µlowtemp = µmodtemp = µhightemp
Ha: at least one pair of means are different

H0: there is no interaction between humidity and temperature
Ha: there is an interaction between humidity and temperature

Computations:

08-21-2016-e

08-21-2016-f

08-21-2016-g

Since all of these p-values are smaller than our α-level of 0.05, we would reject the null hypothesis in all three cases.

Example in R
x=read.table('clipboard', header=T)
attach(x)
fit=aov(score~humidity+temp+humidity:temp)
summary(fit)

*This test can be done with more factors, but for now, let’s just stick with two.

NO

Good lord, I had a bad dream about Annabelle last night. It was horrific. Let me share it with you.

In the dream, I’m in this mostly empty house with my grandma (on my mom’s side) and Annabelle. We are all just standing around when a huge explosion sounds and a giant fireball appears in the distance. We don’t know if this was some sort of nuclear detonation or a volcano erupting, so we (including Annabelle) to go down to the basement just to be safer from whatever was going to start falling from the sky.

So we head down to the basement and I start calling my mom and Nate, trying to get ahold of them to see if they’re safe. No one is answering and I’m getting more and more panicked. Grandma is, of course, making all these snide, sarcastic remarks about my trying to get ahold of people, and I’m yelling at her to shut up because she’s not making things any better (it’s just like in real life!).

Then water starts coming in through the basement’s outside door at quite a rapid rate. All of us try to keep out of the water, climbing halfway up the basement stairs but still not going back upstairs. Then I see that lava is starting to flow in under the door as well. The lava rapidly starts heating up the water to the point that it is too hot to touch. Meanwhile, the water is rising higher and higher, faster and faster. I’m still on the phone, trying to get in touch with my mom and Nate, panicking because I don’t know if they’re safe or if they’re worried about us.

The water keeps rising and is suddenly nearing the very top of the basement. My grandma and I are on the top few stairs and realize we have to get out. I then notice that Annabelle is not with us. She’s on the top of a bookshelf which is rapidly being surrounded by the rising water. She’s not anywhere near the stairs, and there’s no way I can save her.

I start screaming from the top of the stairs, “I’m sorry, Annabelle! I’m sorry! I’m sorry I can’t save you, I love you!” The water keeps rising and rising and I can’t see her anymore, but I know she’s going to drown.

It was the worst dream I’ve had in a while. I hate dreams involving bad things happening to my kitties, and I really hate dreams where I have no control over the bad things that are happening. The only comfort to this dream is knowing that in real life I 100% would have waded through the boiling hot water to try and save Annabelle. No question.

The Hot, Sweet, August 2016 List

  • ZOMG, somebody uploaded all the TaleSpin episodes to YouTube. Time to binge watch my childhood.
  • I’MMA COMMIN’ BACK TO MOSCOW! For a week, that is. My mom’s picking me up tomorrow and I’m going to spend next week in the ‘Scow. This is mainly because we both miss each other and I don’t know when I’ll be able to visit next.
  • It’s taking all my willpower not to go buy like 1,000 Pokemon cards, I’m not even kidding.
  • OH MY GODDDD
  • Hahaha:

  • I made a salad tonight and put so much pepper on it that it tasted like it shot out of the devil’s anus. As disgusting as that sounds, it was actually really damn good.
  • I CAN’T BELIEVE I GET TO TEACH AGAIN OMFG I’M SO EXCITED
  • I wonder who my TAs will be. It would be super weird if they were people I know, like Charles or Tayler.

I thought this list was going to be longer. NOPE.

THIS JUST IN:

I am trash and should be disposed of immediately.

STRESS MODE ACTIVATED

I am in a crappy mood and thus have no desire to blog.

So have some (NSFW) internet nonsense and leave me alone.

 

I remember this, oh my god:

 

THIS TOO. Aaron found this back when we were all living in the house. We would yell “WHAT?!?!” at each other at every opportunity for like three months after seeing this:

 

Matt brought these to my attention awhile ago and I just re-found it on my “liked” videos playlist on YouTube.

CleAwesome

Hot damn, I want one.

Super cute.

I may or may not be a little obsessed with Clefairy and Clefable right now. Blame the noises they make in Pokemon Go. And how soft and happy they look.

08-16-2016-a

 

08-16-2016-b

 

08-16-2016-c

 

SUPER.
CUTE.