Calculating descriptive statistics
up vote
2
down vote
favorite
I'm writing a paper that involves many values. In order to be consistent in all the papers, I'm using def
and xint
to assign and calculate these values. However, in part of this paper I have to present some descriptive statistics about a dataset. And each time that one value in the dataset change, I have to recalculate all descriptive statistics and change many def
. Then, my question is: Is possible to include the dataset in the latex and calculate all descriptive statistics (mean, mediam, min, max, and sum)?
for instance,
given the dataset [1,2,3,4,5,6,7]
I could calculate
Sample Size: 7,
Mean: 4,
Minimum: 1,
Maximum: 7,
Median: 4
programming xint
add a comment |
up vote
2
down vote
favorite
I'm writing a paper that involves many values. In order to be consistent in all the papers, I'm using def
and xint
to assign and calculate these values. However, in part of this paper I have to present some descriptive statistics about a dataset. And each time that one value in the dataset change, I have to recalculate all descriptive statistics and change many def
. Then, my question is: Is possible to include the dataset in the latex and calculate all descriptive statistics (mean, mediam, min, max, and sum)?
for instance,
given the dataset [1,2,3,4,5,6,7]
I could calculate
Sample Size: 7,
Mean: 4,
Minimum: 1,
Maximum: 7,
Median: 4
programming xint
Welcome to TeX.SX! That is an interesting question.
– moewe
Apr 22 '16 at 13:22
I think R program suits for calculation of summaries better. It has knitr or sweave compatible to LaTeX
– Olga K
Apr 22 '16 at 14:06
r-project.org, rstudio.com
– Olga K
Apr 22 '16 at 14:15
Do you always supply the data set in non-decreasing order?
– Werner
Apr 22 '16 at 14:34
Hello Olga, initially I solve my problem with the sagemath. However, Sagemath cloud site is not enoht to my needs. Then I could know that the Sharelatex now support natively the Knitr. And I did all calculation using this package.
– user1032817
May 25 '16 at 19:37
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm writing a paper that involves many values. In order to be consistent in all the papers, I'm using def
and xint
to assign and calculate these values. However, in part of this paper I have to present some descriptive statistics about a dataset. And each time that one value in the dataset change, I have to recalculate all descriptive statistics and change many def
. Then, my question is: Is possible to include the dataset in the latex and calculate all descriptive statistics (mean, mediam, min, max, and sum)?
for instance,
given the dataset [1,2,3,4,5,6,7]
I could calculate
Sample Size: 7,
Mean: 4,
Minimum: 1,
Maximum: 7,
Median: 4
programming xint
I'm writing a paper that involves many values. In order to be consistent in all the papers, I'm using def
and xint
to assign and calculate these values. However, in part of this paper I have to present some descriptive statistics about a dataset. And each time that one value in the dataset change, I have to recalculate all descriptive statistics and change many def
. Then, my question is: Is possible to include the dataset in the latex and calculate all descriptive statistics (mean, mediam, min, max, and sum)?
for instance,
given the dataset [1,2,3,4,5,6,7]
I could calculate
Sample Size: 7,
Mean: 4,
Minimum: 1,
Maximum: 7,
Median: 4
programming xint
programming xint
edited 2 days ago
Andrew
29.3k34178
29.3k34178
asked Apr 22 '16 at 13:13
user1032817
133
133
Welcome to TeX.SX! That is an interesting question.
– moewe
Apr 22 '16 at 13:22
I think R program suits for calculation of summaries better. It has knitr or sweave compatible to LaTeX
– Olga K
Apr 22 '16 at 14:06
r-project.org, rstudio.com
– Olga K
Apr 22 '16 at 14:15
Do you always supply the data set in non-decreasing order?
– Werner
Apr 22 '16 at 14:34
Hello Olga, initially I solve my problem with the sagemath. However, Sagemath cloud site is not enoht to my needs. Then I could know that the Sharelatex now support natively the Knitr. And I did all calculation using this package.
– user1032817
May 25 '16 at 19:37
add a comment |
Welcome to TeX.SX! That is an interesting question.
– moewe
Apr 22 '16 at 13:22
I think R program suits for calculation of summaries better. It has knitr or sweave compatible to LaTeX
– Olga K
Apr 22 '16 at 14:06
r-project.org, rstudio.com
– Olga K
Apr 22 '16 at 14:15
Do you always supply the data set in non-decreasing order?
– Werner
Apr 22 '16 at 14:34
Hello Olga, initially I solve my problem with the sagemath. However, Sagemath cloud site is not enoht to my needs. Then I could know that the Sharelatex now support natively the Knitr. And I did all calculation using this package.
– user1032817
May 25 '16 at 19:37
Welcome to TeX.SX! That is an interesting question.
– moewe
Apr 22 '16 at 13:22
Welcome to TeX.SX! That is an interesting question.
– moewe
Apr 22 '16 at 13:22
I think R program suits for calculation of summaries better. It has knitr or sweave compatible to LaTeX
– Olga K
Apr 22 '16 at 14:06
I think R program suits for calculation of summaries better. It has knitr or sweave compatible to LaTeX
– Olga K
Apr 22 '16 at 14:06
r-project.org, rstudio.com
– Olga K
Apr 22 '16 at 14:15
r-project.org, rstudio.com
– Olga K
Apr 22 '16 at 14:15
Do you always supply the data set in non-decreasing order?
– Werner
Apr 22 '16 at 14:34
Do you always supply the data set in non-decreasing order?
– Werner
Apr 22 '16 at 14:34
Hello Olga, initially I solve my problem with the sagemath. However, Sagemath cloud site is not enoht to my needs. Then I could know that the Sharelatex now support natively the Knitr. And I did all calculation using this package.
– user1032817
May 25 '16 at 19:37
Hello Olga, initially I solve my problem with the sagemath. However, Sagemath cloud site is not enoht to my needs. Then I could know that the Sharelatex now support natively the Knitr. And I did all calculation using this package.
– user1032817
May 25 '16 at 19:37
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
If you're mixing math and LaTeX you should consider looking into the sagetex
package which gives you access to a computer algebra system, called Sage, to handle the math. Documentation on basic statistics is here. You'll need Sage installed locally on your computer or, better yet, you use the free Sagemath Cloud site. In that case, no Sage to download and install.
documentclass{article}
usepackage{sagetex}
usepackage{graphicx}
begin{document}
begin{sagesilent}
MyData = [1,2,3,4,5,6,7]
end{sagesilent}
noindent My data set is $S = sage{MyData}$. For this data:\
The sample size is $sage{len(MyData)}$.\
The mean is $sage{mean(MyData)}$.\
The median is $sage{median(MyData)}$.\
The minimum value is $sage{min(MyData)}$.\
The maximum value is $sage{max(MyData)}$.\
The standarad deviation of the sample is $sage{std(MyData)}$.\
The sum of the data values is $sage{sum(MyData)}$.
end{document}
The output is shown running in Sagemath Cloud; as you can see, the code is short and easily understood.
EDIT: I forgot to compute the median. That is easily accomplished with an extra line.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
If you're mixing math and LaTeX you should consider looking into the sagetex
package which gives you access to a computer algebra system, called Sage, to handle the math. Documentation on basic statistics is here. You'll need Sage installed locally on your computer or, better yet, you use the free Sagemath Cloud site. In that case, no Sage to download and install.
documentclass{article}
usepackage{sagetex}
usepackage{graphicx}
begin{document}
begin{sagesilent}
MyData = [1,2,3,4,5,6,7]
end{sagesilent}
noindent My data set is $S = sage{MyData}$. For this data:\
The sample size is $sage{len(MyData)}$.\
The mean is $sage{mean(MyData)}$.\
The median is $sage{median(MyData)}$.\
The minimum value is $sage{min(MyData)}$.\
The maximum value is $sage{max(MyData)}$.\
The standarad deviation of the sample is $sage{std(MyData)}$.\
The sum of the data values is $sage{sum(MyData)}$.
end{document}
The output is shown running in Sagemath Cloud; as you can see, the code is short and easily understood.
EDIT: I forgot to compute the median. That is easily accomplished with an extra line.
add a comment |
up vote
6
down vote
accepted
If you're mixing math and LaTeX you should consider looking into the sagetex
package which gives you access to a computer algebra system, called Sage, to handle the math. Documentation on basic statistics is here. You'll need Sage installed locally on your computer or, better yet, you use the free Sagemath Cloud site. In that case, no Sage to download and install.
documentclass{article}
usepackage{sagetex}
usepackage{graphicx}
begin{document}
begin{sagesilent}
MyData = [1,2,3,4,5,6,7]
end{sagesilent}
noindent My data set is $S = sage{MyData}$. For this data:\
The sample size is $sage{len(MyData)}$.\
The mean is $sage{mean(MyData)}$.\
The median is $sage{median(MyData)}$.\
The minimum value is $sage{min(MyData)}$.\
The maximum value is $sage{max(MyData)}$.\
The standarad deviation of the sample is $sage{std(MyData)}$.\
The sum of the data values is $sage{sum(MyData)}$.
end{document}
The output is shown running in Sagemath Cloud; as you can see, the code is short and easily understood.
EDIT: I forgot to compute the median. That is easily accomplished with an extra line.
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
If you're mixing math and LaTeX you should consider looking into the sagetex
package which gives you access to a computer algebra system, called Sage, to handle the math. Documentation on basic statistics is here. You'll need Sage installed locally on your computer or, better yet, you use the free Sagemath Cloud site. In that case, no Sage to download and install.
documentclass{article}
usepackage{sagetex}
usepackage{graphicx}
begin{document}
begin{sagesilent}
MyData = [1,2,3,4,5,6,7]
end{sagesilent}
noindent My data set is $S = sage{MyData}$. For this data:\
The sample size is $sage{len(MyData)}$.\
The mean is $sage{mean(MyData)}$.\
The median is $sage{median(MyData)}$.\
The minimum value is $sage{min(MyData)}$.\
The maximum value is $sage{max(MyData)}$.\
The standarad deviation of the sample is $sage{std(MyData)}$.\
The sum of the data values is $sage{sum(MyData)}$.
end{document}
The output is shown running in Sagemath Cloud; as you can see, the code is short and easily understood.
EDIT: I forgot to compute the median. That is easily accomplished with an extra line.
If you're mixing math and LaTeX you should consider looking into the sagetex
package which gives you access to a computer algebra system, called Sage, to handle the math. Documentation on basic statistics is here. You'll need Sage installed locally on your computer or, better yet, you use the free Sagemath Cloud site. In that case, no Sage to download and install.
documentclass{article}
usepackage{sagetex}
usepackage{graphicx}
begin{document}
begin{sagesilent}
MyData = [1,2,3,4,5,6,7]
end{sagesilent}
noindent My data set is $S = sage{MyData}$. For this data:\
The sample size is $sage{len(MyData)}$.\
The mean is $sage{mean(MyData)}$.\
The median is $sage{median(MyData)}$.\
The minimum value is $sage{min(MyData)}$.\
The maximum value is $sage{max(MyData)}$.\
The standarad deviation of the sample is $sage{std(MyData)}$.\
The sum of the data values is $sage{sum(MyData)}$.
end{document}
The output is shown running in Sagemath Cloud; as you can see, the code is short and easily understood.
EDIT: I forgot to compute the median. That is easily accomplished with an extra line.
edited Apr 23 '16 at 0:00
answered Apr 22 '16 at 14:06
DJP
6,89921629
6,89921629
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
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%2ftex.stackexchange.com%2fquestions%2f305764%2fcalculating-descriptive-statistics%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');
});
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');
});
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');
});
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
Welcome to TeX.SX! That is an interesting question.
– moewe
Apr 22 '16 at 13:22
I think R program suits for calculation of summaries better. It has knitr or sweave compatible to LaTeX
– Olga K
Apr 22 '16 at 14:06
r-project.org, rstudio.com
– Olga K
Apr 22 '16 at 14:15
Do you always supply the data set in non-decreasing order?
– Werner
Apr 22 '16 at 14:34
Hello Olga, initially I solve my problem with the sagemath. However, Sagemath cloud site is not enoht to my needs. Then I could know that the Sharelatex now support natively the Knitr. And I did all calculation using this package.
– user1032817
May 25 '16 at 19:37