When to use mean vs median
$begingroup$
I'm new to data science and stats, so this might seems like a beginner question.
I'm working on a dataset where I've user's Twitter followers gain per day. I want to measure the average growth he had over a period of time, which I did by finding the mean of growth. But someone is suggesting me to use median for this.
Can anyone explains, in which use-case we should use mean and when to use median?
statistics descriptive-statistics
New contributor
$endgroup$
add a comment |
$begingroup$
I'm new to data science and stats, so this might seems like a beginner question.
I'm working on a dataset where I've user's Twitter followers gain per day. I want to measure the average growth he had over a period of time, which I did by finding the mean of growth. But someone is suggesting me to use median for this.
Can anyone explains, in which use-case we should use mean and when to use median?
statistics descriptive-statistics
New contributor
$endgroup$
add a comment |
$begingroup$
I'm new to data science and stats, so this might seems like a beginner question.
I'm working on a dataset where I've user's Twitter followers gain per day. I want to measure the average growth he had over a period of time, which I did by finding the mean of growth. But someone is suggesting me to use median for this.
Can anyone explains, in which use-case we should use mean and when to use median?
statistics descriptive-statistics
New contributor
$endgroup$
I'm new to data science and stats, so this might seems like a beginner question.
I'm working on a dataset where I've user's Twitter followers gain per day. I want to measure the average growth he had over a period of time, which I did by finding the mean of growth. But someone is suggesting me to use median for this.
Can anyone explains, in which use-case we should use mean and when to use median?
statistics descriptive-statistics
statistics descriptive-statistics
New contributor
New contributor
New contributor
asked 4 hours ago
Mukul JainMukul Jain
1083
1083
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
The mean is defined as
$mean(bar{x}) = frac{sum_i^n x_i}{n}$
whereas the median is the value which falls directly in the middle of your dataset. The media is especially useful when you are dealing with a wide range.
For example salaries are usually discussed using medians. This due to the large disparity between the majority of people and a very few people with a lot of money. Thus looking at the 50% percentile individual will give a more representative value than the mean in this circumstance. Alternatively, grades are usually described using the mean (average) because most students should be near the average and few will be far below or far above.
$endgroup$
$begingroup$
That's a great answer. So, If I think it like this, I can plot my data and see if it values are continuous, then we can use mean and if they're more clustered (some high and some low), then median would be better, right?
$endgroup$
– Mukul Jain
2 hours ago
$begingroup$
@MukulJain, Yes it depends on the distribution of the data as you mentioned. Plotting is always my go to way to get a sense of my data. Easy to spot anomalies and get a sense of its spread.
$endgroup$
– JahKnows
1 hour ago
add a comment |
$begingroup$
Simply to say, If your data is corrupted with noise or say erroneous no.of twitter followers as in your case, Taking mean as a metric could be detrimental as the model will perform badly. In this case, If you take the median of the values, It will take care of outliers in the data. Hope it helps
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "557"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Mukul Jain is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46744%2fwhen-to-use-mean-vs-median%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
The mean is defined as
$mean(bar{x}) = frac{sum_i^n x_i}{n}$
whereas the median is the value which falls directly in the middle of your dataset. The media is especially useful when you are dealing with a wide range.
For example salaries are usually discussed using medians. This due to the large disparity between the majority of people and a very few people with a lot of money. Thus looking at the 50% percentile individual will give a more representative value than the mean in this circumstance. Alternatively, grades are usually described using the mean (average) because most students should be near the average and few will be far below or far above.
$endgroup$
$begingroup$
That's a great answer. So, If I think it like this, I can plot my data and see if it values are continuous, then we can use mean and if they're more clustered (some high and some low), then median would be better, right?
$endgroup$
– Mukul Jain
2 hours ago
$begingroup$
@MukulJain, Yes it depends on the distribution of the data as you mentioned. Plotting is always my go to way to get a sense of my data. Easy to spot anomalies and get a sense of its spread.
$endgroup$
– JahKnows
1 hour ago
add a comment |
$begingroup$
The mean is defined as
$mean(bar{x}) = frac{sum_i^n x_i}{n}$
whereas the median is the value which falls directly in the middle of your dataset. The media is especially useful when you are dealing with a wide range.
For example salaries are usually discussed using medians. This due to the large disparity between the majority of people and a very few people with a lot of money. Thus looking at the 50% percentile individual will give a more representative value than the mean in this circumstance. Alternatively, grades are usually described using the mean (average) because most students should be near the average and few will be far below or far above.
$endgroup$
$begingroup$
That's a great answer. So, If I think it like this, I can plot my data and see if it values are continuous, then we can use mean and if they're more clustered (some high and some low), then median would be better, right?
$endgroup$
– Mukul Jain
2 hours ago
$begingroup$
@MukulJain, Yes it depends on the distribution of the data as you mentioned. Plotting is always my go to way to get a sense of my data. Easy to spot anomalies and get a sense of its spread.
$endgroup$
– JahKnows
1 hour ago
add a comment |
$begingroup$
The mean is defined as
$mean(bar{x}) = frac{sum_i^n x_i}{n}$
whereas the median is the value which falls directly in the middle of your dataset. The media is especially useful when you are dealing with a wide range.
For example salaries are usually discussed using medians. This due to the large disparity between the majority of people and a very few people with a lot of money. Thus looking at the 50% percentile individual will give a more representative value than the mean in this circumstance. Alternatively, grades are usually described using the mean (average) because most students should be near the average and few will be far below or far above.
$endgroup$
The mean is defined as
$mean(bar{x}) = frac{sum_i^n x_i}{n}$
whereas the median is the value which falls directly in the middle of your dataset. The media is especially useful when you are dealing with a wide range.
For example salaries are usually discussed using medians. This due to the large disparity between the majority of people and a very few people with a lot of money. Thus looking at the 50% percentile individual will give a more representative value than the mean in this circumstance. Alternatively, grades are usually described using the mean (average) because most students should be near the average and few will be far below or far above.
answered 3 hours ago
JahKnowsJahKnows
5,017625
5,017625
$begingroup$
That's a great answer. So, If I think it like this, I can plot my data and see if it values are continuous, then we can use mean and if they're more clustered (some high and some low), then median would be better, right?
$endgroup$
– Mukul Jain
2 hours ago
$begingroup$
@MukulJain, Yes it depends on the distribution of the data as you mentioned. Plotting is always my go to way to get a sense of my data. Easy to spot anomalies and get a sense of its spread.
$endgroup$
– JahKnows
1 hour ago
add a comment |
$begingroup$
That's a great answer. So, If I think it like this, I can plot my data and see if it values are continuous, then we can use mean and if they're more clustered (some high and some low), then median would be better, right?
$endgroup$
– Mukul Jain
2 hours ago
$begingroup$
@MukulJain, Yes it depends on the distribution of the data as you mentioned. Plotting is always my go to way to get a sense of my data. Easy to spot anomalies and get a sense of its spread.
$endgroup$
– JahKnows
1 hour ago
$begingroup$
That's a great answer. So, If I think it like this, I can plot my data and see if it values are continuous, then we can use mean and if they're more clustered (some high and some low), then median would be better, right?
$endgroup$
– Mukul Jain
2 hours ago
$begingroup$
That's a great answer. So, If I think it like this, I can plot my data and see if it values are continuous, then we can use mean and if they're more clustered (some high and some low), then median would be better, right?
$endgroup$
– Mukul Jain
2 hours ago
$begingroup$
@MukulJain, Yes it depends on the distribution of the data as you mentioned. Plotting is always my go to way to get a sense of my data. Easy to spot anomalies and get a sense of its spread.
$endgroup$
– JahKnows
1 hour ago
$begingroup$
@MukulJain, Yes it depends on the distribution of the data as you mentioned. Plotting is always my go to way to get a sense of my data. Easy to spot anomalies and get a sense of its spread.
$endgroup$
– JahKnows
1 hour ago
add a comment |
$begingroup$
Simply to say, If your data is corrupted with noise or say erroneous no.of twitter followers as in your case, Taking mean as a metric could be detrimental as the model will perform badly. In this case, If you take the median of the values, It will take care of outliers in the data. Hope it helps
$endgroup$
add a comment |
$begingroup$
Simply to say, If your data is corrupted with noise or say erroneous no.of twitter followers as in your case, Taking mean as a metric could be detrimental as the model will perform badly. In this case, If you take the median of the values, It will take care of outliers in the data. Hope it helps
$endgroup$
add a comment |
$begingroup$
Simply to say, If your data is corrupted with noise or say erroneous no.of twitter followers as in your case, Taking mean as a metric could be detrimental as the model will perform badly. In this case, If you take the median of the values, It will take care of outliers in the data. Hope it helps
$endgroup$
Simply to say, If your data is corrupted with noise or say erroneous no.of twitter followers as in your case, Taking mean as a metric could be detrimental as the model will perform badly. In this case, If you take the median of the values, It will take care of outliers in the data. Hope it helps
answered 23 mins ago
karthikeyankarthikeyan
205
205
add a comment |
add a comment |
Mukul Jain is a new contributor. Be nice, and check out our Code of Conduct.
Mukul Jain is a new contributor. Be nice, and check out our Code of Conduct.
Mukul Jain is a new contributor. Be nice, and check out our Code of Conduct.
Mukul Jain is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46744%2fwhen-to-use-mean-vs-median%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown