# Correlation/Regression

• ### Fitting the Line

may sing to the tune of "Draggin' the Line" (Tommy James and Bob King)

(Back-up vocals in parentheses)
Plotting the data, on X and Y,
Finding the slope, with most points nearby,
We want to find the angle, of the trend's incline,
Fitting the line (fitting the line),

Upward slopes make r positive,
Slopes trending down, make it negative,
From minus-one to plus-one, r can feel fine,
Fitting the line (fitting the line),
Fitting the line (fitting the line),

Points align, how will the data shine?
If you have upward slopes, it'll give you a plus sign,
Fitting the line (fitting the line),
Fitting the line (fitting the line),

How strongly will your variables relate?
Is there a trend, or just a zero flat state?
You want to know what your analysis will find,
Fitting the line (fitting the line),
Fitting the line (fitting the line),

Points align, how will the data shine?
Your r will be minus, if the slope declines,
Fitting the line (fitting the line),
Fitting the line (fitting the line),

(Guitar solo)

Points align, how will the data shine?
If you have upward slopes, it'll give you a plus sign,
Fitting the line (fitting the line),
Fitting the line (fitting the line)...

• ### Correlation Song

may sing to the tune of the English lullaby "Twinkle Twinkle Little Star" (Jane Taylor)

Are points near a line, or far?
What's the correlation, r?
If the fit supports a line,
Its slope and r would share the sign.
Twinkle, twinkle, you're a star:
Knowing stats will take you far!

• ### Rho Rho Rho

Lyric copyright by Lawrence Mark Lesser and Dennis K Pearl
may sing to the tune of the children's folk song "Row Row Row Your Boat"

Rho, rho, rho he wrote
aligning x and y
popu-lation corre-lation
how the points should lie

• ### Partial to You

Music and lyrics ©2010-2013 by Lawrence Mark Lesser

I feel young when you're near me:
I regress easily!
My age held constant by all you do -
I'm partial to you.

My old "(e)x", I sent back 'cause
We were unstable from too much overlap.
Then you brought so much new -
I'm partial to you.

Love explained can't be denied:
Our fit makes R-square high.
We're homoskedastic and normal too -
I'm partial to you . . . partial to you.

• ### The Line

May be sung to the tune of "The Middle" (Jimmy Eat World)

Data, a scattered n by p set.
It's only in your points you feel spread out, and without trend.
You want to test if your set's a scam
and you worry when they tell your points, "you're unexplained!"

It just takes a line,
X prime X beta equals X prime Y!
Everything, everything will fit just fine.
Everything everything will fit alright, alright.

Beta, you define that plane.
That hat you're wearing makes you look pretty BLUE, but no, not sad.
You fit great, the data need a friend.
It doesn't matter if it's up or down, go find some trends!

It just takes a line, X prime X beta equals X prime Y!
Everything, everything will fit just fine.
Everything everything will fit alright, alright.

It just takes a line,
Gauss and Markov they were pretty fly guys!
Everything, everything will fit just fine.
Everything everything will fit alright, alright.

Data, a scattered n by p set.
It's only in your points; they feel spread out, and without trend.
Just do your test, with beta hat's great plane,
and hope that every x in your set... remains!

It just takes a line,
X prime X beta equals X prime Y!
Everything, everything will fit just fine.
Everything, everything will fit alright, alright.

It just takes a line,
minimize the sum of squares and it's a sign!
Everything, everything will fit just fine.
Everything, everything will fit alright, alright.

Watch the video

• ### Shrink It

Lyrics copyright by Bradley Turnbull, Joe Usset, Sidd Roy, and Kyle White
May be sung to the tune of "Shake It" (Metro Station)

I got a beta hat and great I get a zero score.
Least squares works, but prediction's so poor.
And I was thinking of ways that I could penalize.
I need some zero values!
LASSO is what I choose!

You tune that baby up;
just the best will come back.
If prediction's all you want, OLS is on crack.
Just shrink those betas down,
then you loop it right back.
(Thank you,)
Tib-Tib Tib-Tib-shir-a-ni!!

and without a lambda you feel so singular.
So I was thinking of ways that I could penalize.
Makes no sense to select!
Ridge regression perfect!

Now you leave one out, then you find a Y-hat.
Then you sum them all up, yeah pick lambda like that.
Now beta's pretty small, but you like it like that.
(Come on!)

Shrink shrink, shrink shrink, shrink it!!

My beta's biased but
I kissed some variance goodbye.
My MSE is not so mean,
I guess this was worth my time?

so I will look up and pray:
I can adapt and you can show me the way (way).

Now we're penalizing beta with a norm in L1
and a fan of Thomas Bayes isn't missing any fun
'cause a double exponential
and the mode can get it done, c'mon!

Tib-Tib Tib-Tib-shir-a-ni!!
Shrink shrink, shrink shrink, shrink it!!

Watch the video