So, inspired by by this, here's a thing I think quite a few people may have not noticed in #rstats (and other programming languages). When I first saw this i was like what the heck R is broken someone pls help. Image
R does something called bankers rounding. If you have a lot of n.5 numbers in a vector and you were to do your normal rounding where 0.5 rounds up then that would increase the mean of your sample. By rounding .5 to the nearest even number R avoids this bias.
Moments pause as I crashed my computer generating a huge vector because I am a fool.
You can have this issue even with normal distributions - illustrated here. With a dataset which had lots of n.5s the drift in the mean would be much greater. ImageImageImage
There was probably a more elegant way of doing this so do excuse my slapdash code. If I add 0.5 to all my rounded numbers, then take the mean of the vector, rounded normally (as opposed to bakers rounding) you get this, where the mean has shifted by nearly 1: Image
My favourite bit about this was that I told R to generate me a vector of 10,000 numbers with a mean of 1000 and then proceeded to check the mean XD

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Dr Dani Rabaiotti

Dr Dani Rabaiotti Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @DaniRabaiotti

20 Feb
So I've seen a fair few 'it's wrong to send a rover to mars when species are dying' takes - and I personally think they are misguided and potentially damaging.

And I say this as someone who really doesn't like space! (1/n)
First off, let's look at the cost: $2.6 billion.

That's literally a drop in the ocean in terms of government budgets. They could quite easily spend that on sending a rover to Mars AND spend the same on conservation. (2/n)
The US military budget is $849 billion. Yet no-one is ever like how come the govt is spending money on bombs not conservation. It's only ever when it's another field of science, or something culturally important like the Notre Dame fire that this comes up. (3/n)
Read 8 tweets
19 Feb
You've heard of feeding the ducks but how about feeding the herons?
Nice of them to install a new pond on Clapham common
God I am so so so so sick of mud.
Read 4 tweets
18 Feb
It's a good job I'm so utterly drained and exhausted because otherwise I'd just be pure rage right now.

Instead I'm just tired and sad.
I can't address what has come to light, and indeed is still coming to light, in the birding world this week anywhere near adequately. Heck I can barely manage to get out my pyjamas.
But what I will say is this. Encouraging women into a field where they are underrepresented and feel unwelcome only to use it to hook up with them is absolutely gross behaviour on its own.
Read 6 tweets
10 Jan 20
This is so much in my wheelhouse that I'm going to have to do a modelling thread aren't I? I hope you're all excited ^_^

Bear with me I'll get on it shortly.
Right: welcome, gather round all.

Let's talk projections.

Projections are really important in science. As our man Craig points out - we can't spend the time counting every single thing that's out there. It would take a reeeaaally long time, and often it is hard to find.
Read 19 tweets
29 May 19
On my first day in Botswana I saw a baby leopard and look how cute it is Baby leopard
I've previously only seen brief glimpses of leopards as they walked through long grass, so it was incredible to see them so close and relaxed. Mum was busy having dinner up a tree. They do this to keep the kill away from lions and hyenas Leopard eating an antelope up a tree
Baby kept close watch Baby leopard looking up
Read 5 tweets
29 Dec 18
There's a lot of really inspirational people on Twitter, but I want to name a few that have inspired me this year! (a thread) #tweepspiration2018
1. @jesswade - Jess has has a storming year creating hundreds of profiles for women scientists on @Wikipedia and successfully crowdfunded to get copies of @AngelaDSaini's Inferior into schools!! I also met her and she is totally awesome.
theguardian.com/education/2018…
2. @alexevans91 - grew #guessthecrest completed his PhD, got a job, and hit 100,000 unread emails in his inbox. Absolute hero.
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!