2022 Developer Survey is open! Take survey.

Questions tagged [statistics]

{statistics} if for questions related to statistics software/graphics/packages and TeX.

94 questions
Filter by
Sorted by
Tagged with
41 views

Displaying moderator analysis with 3 variables with LaTeX

i found how to do a mediation here : Displaying mediator analysis with LaTeX (TikZ-pfg maybe?) but i don't manage to transform it to a moderation like this : I'd like to keep the possibility to put ...
28 views

Creating a "data-dump" table procedurally?

I have a ~50 sample dataset I'd like to put into a table. Because there's only one variable to display, a single column chart looks ridiculous and wastes a lot of space. Is there a way I can get it to ...
113 views

What are good ways to convert SQL query results into a LaTeX table?

Background I'm doing some data analysis on a large dataset on a local SQL server. A substantial proportion of that analysis is tabular stuff: frequency tables and the like which summarize various ...
• 203
65 views

Making a frequency distribution using intervals

I am trying to get help with a statistics problem. It is not advanced by any means and I know very well how to solve it. I just happened to stumble across LaTeX and got interested in learning how to ...
22 views

Why pgfplots's histogram vertical axis magnitude in %? [duplicate]

According to example from manual for pgfplots (page 512), the default behaviour of hist={density} is a plot My MWE result y-axis magnitude realize in % (not in per-one). Why? \documentclass{article} \...
• 4,932
96 views

How can I write the weibull probability formula?

I would be very grateful if you could help me on how to write this formula.
• 51
1 vote
67 views

How do I make a table to represent a discrete probability distribution?

I have a discrete probability distribution p(x) with the support ${\mathcal {X}} = {0,1,2,3,4,5,6,7,8,9}$ and I'd like to represent the distribution in the form of a table, similar to the one below ...
• 470
1 vote
44 views

semilogx histogram with log-spaced bins in pgfplots

Is it possible to make a histogram in PGFPlots on a logarithmic x-axis, with equal-sized (in log space) bins? Just using semilogxaxis and hist fails as expected. Apparently there is no way to specify ...
• 334
48 views

Statistics in TexShop does not count words in tables

I am finished with a scientific paper for a conference, but it does not contain the requested 7000 words. For this reason I have changed my figures with a lot of text into tables. The statistics under ...
• 81
151 views

Align environment end {align*} error

I have an issue to run the following code in an align environment: \begin{align*} &\mathrm{ E(Y_i|D_i=1)-E(Y_i|D_i=0)&=E(Y_{1i}|D_i=1)-E(Y_{0i}|D_i=0) }\\ \mathrm{ &=\...
59 views

How to represent small numbers in academic writing?

I am seeking some suggestions through this query. In case this is not the right forum, kindly suggest where I may get an answer? I need to represent small numbers in multiple tables meant for ...
• 329
79 views

How do I get LaTeX to perform an exponential regression?

I have been trying to get some regressions for my estimates, but there seems to be only content on polynomial and linear regression. This is the code I use for linear: \begin{center} \begin{figure}[...
• 21
1 vote
109 views

Question on writing symbols (~, tilde)

I was wondering if anyone can show me how to write ~ in Latex as I am new to Latex and trying to write my statistics notes in a neat format. I've surfed around the web, but could not find it.
1 vote
61 views

Write an equation showing a condition indicating correlation between two variables

I am trying to write this conditional equation: I am not sure what could be the mathematical syntax for saying: "variables x and y are correlated". While searching for this, I came to know ...
• 111
1 vote
61 views

Plain Vanilla'' Statistical Images with LaTeX

I am looking to produce some very basic (nothing fancy), easily modifiable, statistical images for illustrative purposes in Latex. Such as these: Although it may not be clear from the images, there ...
207 views

The Simplest Way to Produce the Standard Normal Distribution with Shading and Key Information Displayed

I would like to replicate I have spent some time searching this site to find LaTeX code for producing a normal distribution that I can modify. But many use \pgfmathdeclarefunction{gauss}{2}{% \...
1 vote
1k views

New command for Covariance not working

I am trying to use \newcommand for \mathrm{Cov} but in my output I am not getting the symbol for Covariance as I wanted. My LaTeX code: $\newcommand{\Cov}{\mathrm{Cov}}$ \begin{align*} A\Cov(X_1,Y)...
94 views

Why does loading multiple pgfplotslibraries in the same command sometime break the libraries?

I'm making some boxplots with the pgf statistics library. And I found the following. This: \documentclass{standalone} \usepackage[T1]{fontenc} \usepackage{fontspec} \usepackage{tikz} \usepackage{...
1 vote
1k views

Write notes under tables generated with stargazer

I created these descriptive statistics table using the stargazer" package, in RStudio and I would like to write a note under this table, but I am not able to. The only thing I could do was a ...
44 views

Print some document's statistics in preamble (eg. nb. of pages for each section)?

I'm searching for a way to get then print some statistics of my PhD thesis pdfLaTeX document in order to give some practical data to my supervisors on my writing progress (and also to help me get a ...
• 179
1 vote
73 views

pgfplots: line sharp plot histogram - value is missing and values too much

I have values 1 2 2 3 3 4 4 4 4 5 5 5 6 6 and want that to plot as a line sharp plot histogram. So, I set: hist={ handler/.style={sharp plot}, intervals=false, }, But he does not want to show the 2 ...
• 6,217
217 views

Statistics Table too large [duplicate]

I would like to display some statistics and difference in means by treatment arm on a single table. The data is exported from stata. I would like to allocate more space to the first column with the ...
115 views

Plotting cdf of a binomial distribution in tikz/pdfplot

I have been trying to plot the cdf (commulative density function) of a binomial distribution - in the easiest way possible (is there a package i could use?) I would be glad if somebody already ...
• 185
194 views

Calculate percentage of quotes in a latex document?

I need to figure out how many percent of the text in my latex document which consists of quotes (in block quotes, particularly). I have wrapped all quotes in the block quotes command: \begin{quote} \...
• 191
176 views

3D normal diffusion with a drift

Based on 3D normal diffusion I want to draw the idea the normal distribution is flattening over time, but with a drift. 1 - As you can see in MWE below, the orange normal distribution seems to be cut ...
• 2,447
1 vote
236 views

median calculation in boxplots

When I try to output the median value of a dataset with \pgfplotsboxplotvalue{median}} in a boxplot, the computed value is not the actual median (see below: 2.5 instead of 3). Is there a way to fix ...
• 13
153 views

Typesetting a five-number summary

I have used a command to typeset a three- or five-number summary in LaTeX, but I can't remember the package name nor find it searching with Google or on StackExchange. Can you tell me the name of the ...
• 101
68 views

Counting values by a 0.5 step before drawing an histogram

In this question, I asked how to draw an histogram showing the repartition of the marks of my students. In the following example, I would like a have a more precise picture: a bar for student whose ...
• 6,130
1k views

How to Display Conditional Probability in LyX?

I am looking for a way to show $P(\theta|X)$ but with the proper spacing?
• 163
564 views

Dot and whisker plot in PGFplots

Sometimes it is useful to present the coefficients of a regression with accompanying confidence intervals as a dot-and-whisker plot. See here for a motivation of this approach and some examples of ...
• 345
175 views

how to draw CDF function for Poisson law tikz

Does anyone know how to draw the Cumulative distribution function of Poisson Distribution (explained here) in tikzpicture environment? I tried with cumulative sums... without success. Many thanks!
1 vote
95 views

pgfplots boxplot without outliers, but with extrema [duplicate]

In response to this question asking about how pgfplots boxplots can be produced without outliers, this answer suggested a fix that does not seem to work anymore. (I am not the first to notice this as ...
• 2,659
145 views

Fiddling with Box plot using statistics library

For anyone who is experienced with the statistics package please give me some tips on how to achieve the following: 1. shaded in the box with gray!30 2. move the whole boxplot up by 0.25 unit so it is ...
• 1,904
849 views

pgfplots: How to draw boxplot pairs separated in two y axis?

The user Korijn has posted a nice approach on how to create pairs of boxplots which are belonging to each other. Minimum Working Example (MWE): \documentclass[border=2mm]{standalone} \usepackage{...
• 3,448
29 views

Table does not use entire space of page! [duplicate]

My table cannot fit on one page. If I could only split the table up over two pages or maybe make it start in the very top of the page instead of beginning the table in like the middle of the page then ...
2k views

What font is "z" in "z-score"?

I noticed that the letter z is different from other font. Is there any special command for this?
• 311
148 views

Normal multivariate standard TIKZ [closed]

I need to perform this graph in TIKZ, there is no need to be equal, it is to be approximated.
124 views

Lines of code counter

Is there a way to automatically count the lines of code of a TeX document? And if yes, is there a way to include that in the document? I would like to have something like "this document is n lines of ...
• 1,212
1 vote
548 views

pgfplots Histogram with Curves [closed]

Variations on this question have been asked many times before, but I have not been able to find a working solution. The closest I have seen are discussions on other stackexchanges concerning how to ...
• 591
1 vote
217 views

pgfplots Histogram with Automatically Calculated Percentage Bins

I have a CSV file. The CSV file contains several columns. I want to plot a histogram that displays: As the x axis: bins for the percentage of rows, that can be changed; As the y axis: the cell ...
• 591
1 vote
1k views

pgfplots Line Histogram

I have a histogram. It is created from data in a CSV file. I would like to connect the mid points on each bar with a smooth line. My intention is to plot multiple series and show just the lines. ...
• 591
1 vote
371 views

pgfplots Histogram with Normal Curve

Variations on this question have been asked multiple times before, but I have been unsuccessful in getting them to work. I may be (and most likely am) just inept at statistics. I wish to plot a ...
• 591
1 vote
374 views

Combine boxplot and histogram in one diagram (PGF/TikZ)

For my bachelor thesis I did a questionnaire, now I want to evaluate and visualise it in a diagram, combining multiple values. Most of the answers from this survey are in a scale of 1-5 or 1-6. I want ...
815 views

Brownian motion, normal distribution (3D)

Following a previous question, this representation that might be even more pedagogic in 3D. Based on this working example extracted from This post \documentclass[border=5mm]{standalone} \usepackage{...
• 2,447
343 views

How to properly draw a histogram?

Surely it is an easy problem but I can't find a solution. Imagine you want to simulate a Gaussian distribution of frequencies around a mean value with a certain spread. It is an easy task to write the ...
• 416
1k views

Cannot find package stata.sty [duplicate]

I am using the command texdoc on stata to generate LaTex code. However, whenever I try running the code using pdfLaTex on TexWorks, I get an error saying that the package stata.sty could not be found ...
553 views

Include average in boxplot

I would like to include an average into my boxplots. The boxplots are made using https://tex.stackexchange.com/a/183856/164280 as an example. I have seen in How to show the mean or average value on a ...
• 461
1 vote
173 views

Dimension too large for a boxplot with pgfplots

I can not display the tick marks on the x-axis. \starttikzpicture \startaxis[ y=1.5cm, axis y line=none, axis x line=bottom, enlarge x limits, ...
• 3,482
1k views

"Undefined control sequence" Regression table from Stata

I am completely new to LaTeX. I work in the TeXworks editor. I would like to create regression tables with results from Stata for my master's thesis. Using the Stata command "esttab", I created a .tex ...
• 41
I am wondering about something. I know I should write function non-italic. like sin and cos, But I am not sure if test statistic symbols like $T^2$ should be written italic (default) or with \mathrm. ...