# Statistics

**URL:** https://discourse.julialang.org/c/domain/stats/12.md?page=7

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 8

---

## [New: FastParzenWindows.jl](https://discourse.julialang.org/t/new-fastparzenwindows-jl/93231)

<div class="topic-metadata">

**Author:** [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Replies:** 2\
**Last updated:** [January 19, 2023, 9:27pm UTC](https://discourse.julialang.org/t/new-fastparzenwindows-jl/93231 "2023-01-19T21:27:37Z")

</div>

Hello everyone, I have finally managed to sufficiently polish a package so that it can hopefully be useful to others. I have now registered it with the general registry. The package can be found at: The package imple…

---

## [Where is T distribution on Distributions.jl?](https://discourse.julialang.org/t/where-is-t-distribution-on-distributions-jl/92887)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 1\
**Last updated:** [January 12, 2023, 6:17pm UTC](https://discourse.julialang.org/t/where-is-t-distribution-on-distributions-jl/92887 "2023-01-12T18:17:39Z")

</div>

Hello, good morning. Tryed search on documentation, but cant find a T distribution on julia Distributions.jl. Where can I find it?

---

## [Conditional logit (clogit) in Julia?](https://discourse.julialang.org/t/conditional-logit-clogit-in-julia/64215)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 4\
**Last updated:** [January 10, 2023, 5:39pm UTC](https://discourse.julialang.org/t/conditional-logit-clogit-in-julia/64215 "2023-01-10T17:39:20Z")

</div>

Given it isn’t at all my subject, a colleague of mine interested in Julia asked if there is a Julia package that implements the “conditional logit” model, similar to the clogit function in R survival package. Having br…

---

## [Range (statistics)](https://discourse.julialang.org/t/range-statistics/92518)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 23\
**Last updated:** [January 6, 2023, 9:09am UTC](https://discourse.julialang.org/t/range-statistics/92518 "2023-01-06T09:09:58Z")

</div>

I often need to compute a statistical range (difference between maximum and minimum). Is there a function in the Statistics standard library to compute the range? Or should we use: maximum(x) - minimum(x)?

---

## [Prevent GLM from dropping rows with missings](https://discourse.julialang.org/t/prevent-glm-from-dropping-rows-with-missings/92569)

<div class="topic-metadata">

**Author:** [@croberts](https://discourse.julialang.org/u/croberts)\
**Replies:** 1\
**Last updated:** [January 5, 2023, 7:25pm UTC](https://discourse.julialang.org/t/prevent-glm-from-dropping-rows-with-missings/92569 "2023-01-05T19:25:26Z")

</div>

The @formula macro allows the construction of variables when creating a model matrix. This is great! I don’t have to add various transformations of variables to a DataFrame simply because I want to try alternative regr…

---

## [Regression with variables in array](https://discourse.julialang.org/t/regression-with-variables-in-array/92280)

<div class="topic-metadata">

**Author:** [@Agnes\_H](https://discourse.julialang.org/u/Agnes_H)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 10:51am UTC](https://discourse.julialang.org/t/regression-with-variables-in-array/92280 "2022-12-30T10:51:38Z")

</div>

I apologize for reheating this old topic, but how do I deal with this when both variables are dependent on a list? I tried using term, but was unable to. The only way I was able to receive meaningful output was by using …

---

## [How to create a loop for a regression model?](https://discourse.julialang.org/t/how-to-create-a-loop-for-a-regression-model/55829)

<div class="topic-metadata">

**Author:** [@younghan-lee](https://discourse.julialang.org/u/younghan-lee)\
**Replies:** 7\
**Last updated:** [February 24, 2021, 6:36am UTC](https://discourse.julialang.org/t/how-to-create-a-loop-for-a-regression-model/55829 "2021-02-24T06:36:16Z")

</div>

Hi everyone, I’m new to Julia and I’m trying to create a loop for a regression model. For example, list = \[:A, :B, :C\] for i in list result = lm(@formula(i ~ X1 + X2), data) println(result) end Something like…

---

## [StableRNG in Turing is not producing reproducible output](https://discourse.julialang.org/t/stablerng-in-turing-is-not-producing-reproducible-output/92032)

<div class="topic-metadata">

**Author:** [@Sourish](https://discourse.julialang.org/u/Sourish)\
**Replies:** 12\
**Last updated:** [December 23, 2022, 3:45pm UTC](https://discourse.julialang.org/t/stablerng-in-turing-is-not-producing-reproducible-output/92032 "2022-12-23T15:45:36Z")

</div>

Hi All: In the following code, we are using StableRNGs. However, the results are not reproducing. Can anybody help us? So that we can reproduce the results. using Turing, StableRNGs @model function example(x) m ~ …

---

## [HypothesisTests, rand and very low pvalue](https://discourse.julialang.org/t/hypothesistests-rand-and-very-low-pvalue/91939)

<div class="topic-metadata">

**Author:** [@fpoling](https://discourse.julialang.org/u/fpoling)\
**Replies:** 1\
**Last updated:** [December 21, 2022, 9:53am UTC](https://discourse.julialang.org/t/hypothesistests-rand-and-very-low-pvalue/91939 "2022-12-21T09:53:56Z")

</div>

Consider the following code: using Distributions import HypothesisTests as HT HT.pvalue(HT.ApproximateOneSampleKSTest(rand(Normal(), 1\_000\_000), Normal())) I expected that the answer will be very close to one, but depe…

---

## [Numerically stable "cumulative variance" function in O(n)](https://discourse.julialang.org/t/numerically-stable-cumulative-variance-function-in-o-n/91872)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 5\
**Last updated:** [December 19, 2022, 8:12pm UTC](https://discourse.julialang.org/t/numerically-stable-cumulative-variance-function-in-o-n/91872 "2022-12-19T20:12:43Z")

</div>

I’m posting this in off-topic because my question is about algorithmic complexity and not about Julia performance. I’m trying to write a function that computes the cumulative variance of a vector x–that is, the vector y …

---

## [Generalization of the Turing Bayesian logistic regression example](https://discourse.julialang.org/t/generalization-of-the-turing-bayesian-logistic-regression-example/91257)

<div class="topic-metadata">

**Author:** [@lgmendes](https://discourse.julialang.org/u/lgmendes)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 8:34am UTC](https://discourse.julialang.org/t/generalization-of-the-turing-bayesian-logistic-regression-example/91257 "2022-12-06T08:34:43Z")

</div>

How to generalize the example of the Bayesian logistic regression \[turning\] for programmatically accepting input data with a different number of features, similar to what is possible in the Multinomial logistic regressio…

---

## [Characteristic Functions --\> pdf using fft?](https://discourse.julialang.org/t/characteristic-functions-pdf-using-fft/91060)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 11\
**Last updated:** [December 5, 2022, 1:16pm UTC](https://discourse.julialang.org/t/characteristic-functions-pdf-using-fft/91060 "2022-12-05T13:16:04Z")

</div>

I have to work on a problem that requires me to use characteristic functions to represent random variables, as these particular rv’s have no close form distribution. The last time I did something remotely similar was at …

---

## [How to create sample random numbers from a custom distribution?](https://discourse.julialang.org/t/how-to-create-sample-random-numbers-from-a-custom-distribution/90744)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 12\
**Last updated:** [December 2, 2022, 9:59am UTC](https://discourse.julialang.org/t/how-to-create-sample-random-numbers-from-a-custom-distribution/90744 "2022-12-02T09:59:01Z")

</div>

I want to create a series of random numbers from a custom distribution. Suppose I have a data set named iris: julia\> using RDatasets julia\> iris = dataset("datasets", "iris"); Now I want to generate 100 random numbers…

---

## [Calling julia GeneralizedMixedModel from R](https://discourse.julialang.org/t/calling-julia-generalizedmixedmodel-from-r/90752)

<div class="topic-metadata">

**Author:** [@jmag](https://discourse.julialang.org/u/jmag)\
**Replies:** 1\
**Last updated:** [November 28, 2022, 11:18am UTC](https://discourse.julialang.org/t/calling-julia-generalizedmixedmodel-from-r/90752 "2022-11-28T11:18:53Z")

</div>

I’m trying to fit huge datasets using julia from R. I originally tried jglmm (GitHub - mikabr/jglmm: R package for interfacing with Julia's GLMM library), but the resulting objects are difficult to work with. I initiall…

---

## [Random variables in Julia (working list)](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 36\
**Last updated:** [November 27, 2022, 8:49am UTC](https://discourse.julialang.org/t/random-variables-in-julia-working-list/48762 "2022-11-27T08:49:29Z")

</div>

Here is my summary of probability distributions in Julia. This is a Julia version of CRAN Task View: Probability Distributions. Packages with distributions: Package Description Note Distributions.jl fit(), ra…

---

## [Opposite of StatsBase.percentile](https://discourse.julialang.org/t/opposite-of-statsbase-percentile/90592)

<div class="topic-metadata">

**Author:** [@Piotr](https://discourse.julialang.org/u/Piotr)\
**Replies:** 5\
**Last updated:** [November 21, 2022, 2:59pm UTC](https://discourse.julialang.org/t/opposite-of-statsbase-percentile/90592 "2022-11-21T14:59:43Z")

</div>

This function returns a NUMBER for a given PERCENTILE. I don’t know what the OP had in mind, but e.g. what I am looking for right now is exactly the thing that the name of this thread points to and which is the very opp…

---

## [Get WCSS (Within-Cluster Sum of Square) for optimal number of clusters in kmeans](https://discourse.julialang.org/t/get-wcss-within-cluster-sum-of-square-for-optimal-number-of-clusters-in-kmeans/90374)

<div class="topic-metadata">

**Author:** [@indymnv](https://discourse.julialang.org/u/indymnv)\
**Replies:** 0\
**Last updated:** [November 16, 2022, 11:34pm UTC](https://discourse.julialang.org/t/get-wcss-within-cluster-sum-of-square-for-optimal-number-of-clusters-in-kmeans/90374 "2022-11-16T23:34:40Z")

</div>

I want to use kmeans for a clustering project, and I need to get the optimal number of clusters with the elbow method, is there a way to get the WCSS in the implementation of Clustering.jl to build something like this …

---

## [How to get number of real levels of InteractionTerm from fitted model (GLM) via StatsModels?](https://discourse.julialang.org/t/how-to-get-number-of-real-levels-of-interactionterm-from-fitted-model-glm-via-statsmodels/89846)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 10\
**Last updated:** [November 15, 2022, 2:59pm UTC](https://discourse.julialang.org/t/how-to-get-number-of-real-levels-of-interactionterm-from-fitted-model-glm-via-statsmodels/89846 "2022-11-15T14:59:06Z")

</div>

I want to get a number of levels of InteractionTerm (not all combination, but real exist) from the fitted model. I can’t get it as the number of columns in model-matrix because it can be made with DummyCoding or FulDummy…

---

## [What is the difference (interpretation) between the partial R^2 and the SHAP value for a linear regression model?](https://discourse.julialang.org/t/what-is-the-difference-interpretation-between-the-partial-r-2-and-the-shap-value-for-a-linear-regression-model/90265)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 0\
**Last updated:** [November 14, 2022, 11:27pm UTC](https://discourse.julialang.org/t/what-is-the-difference-interpretation-between-the-partial-r-2-and-the-shap-value-for-a-linear-regression-model/90265 "2022-11-14T23:27:31Z")

</div>

Both calculate the contribution of a given variable to the output’s variability but… To calculate the coefficient of partial determination R2 for a given variable: We calculate the R2 with and without that variable and…

---

## [Regression with categorical variables. Reference porevious levels. Dummy](https://discourse.julialang.org/t/regression-with-categorical-variables-reference-porevious-levels-dummy/90194)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 5\
**Last updated:** [November 14, 2022, 11:08pm UTC](https://discourse.julialang.org/t/regression-with-categorical-variables-reference-porevious-levels-dummy/90194 "2022-11-14T23:08:49Z")

</div>

Hello. If a do a linear regression model I can include the year as a categorical variable (instead of numerical) in order to estimate a different coefficient for each year. This is commonly done when the variable is not…

---

## [Proper use of MDS and PCA](https://discourse.julialang.org/t/proper-use-of-mds-and-pca/90257)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 4\
**Last updated:** [November 14, 2022, 9:40pm UTC](https://discourse.julialang.org/t/proper-use-of-mds-and-pca/90257 "2022-11-14T21:40:49Z")

</div>

Assume I have a 20\*85 matrix. Here is my code M = fit(PCA, matrix; maxoutdim=2) Yte = predict(M, matrix) M1 = fit(MDS, matrix; maxoutdim=2, distances=false) Yte1 = predict(M1) My Yte and Yte1 are identicall…

---

## [What is the future of StatsModels.jl](https://discourse.julialang.org/t/what-is-the-future-of-statsmodels-jl/90255)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 0\
**Last updated:** [November 14, 2022, 6:47pm UTC](https://discourse.julialang.org/t/what-is-the-future-of-statsmodels-jl/90255 "2022-11-14T18:47:21Z")

</div>

Hi! I am afraid, that more than year there was no significant commits into StatsModels.jl. As I understand devs are planning to remake FunctionTerm and some other less sensitive things. So I try to understand what is rea…

---

## [\[Turing.jl\] Warning: The current proposal will be rejected due to numerical error(s)](https://discourse.julialang.org/t/turing-jl-warning-the-current-proposal-will-be-rejected-due-to-numerical-error-s/72396)

<div class="topic-metadata">

**Author:** [@weiqi](https://discourse.julialang.org/u/weiqi)\
**Replies:** 2\
**Last updated:** [November 10, 2022, 4:43pm UTC](https://discourse.julialang.org/t/turing-jl-warning-the-current-proposal-will-be-rejected-due-to-numerical-error-s/72396 "2022-11-10T16:43:26Z")

</div>

I am running MCMC with Turing.jl for an ODE model. The model contains about 111 parameters. I have noticed that the sampler constantly gives the following warning due to the truncated distribution for prior. Wondering i…

---

## [AssertionError: isfinite(phi\_c) && isfinite(dphi\_c) when estimating EGARCH](https://discourse.julialang.org/t/assertionerror-isfinite-phi-c-isfinite-dphi-c-when-estimating-egarch/89841)

<div class="topic-metadata">

**Author:** [@ultratrader](https://discourse.julialang.org/u/ultratrader)\
**Replies:** 0\
**Last updated:** [November 6, 2022, 3:40pm UTC](https://discourse.julialang.org/t/assertionerror-isfinite-phi-c-isfinite-dphi-c-when-estimating-egarch/89841 "2022-11-06T15:40:50Z")

</div>

I tried to forecast VaR(Value at Risk) based on GARCH model using ARCHModels.jl. I found no problem for standard GARCH and TGARCH. using TimeSeries, MarketData, ARCHModels using Plots, Dates, Missings startdate = DateTi…

---

## [ANOVA and TukeyHSD](https://discourse.julialang.org/t/anova-and-tukeyhsd/89750)

<div class="topic-metadata">

**Author:** [@Rudiney](https://discourse.julialang.org/u/Rudiney)\
**Replies:** 4\
**Last updated:** [November 4, 2022, 1:53pm UTC](https://discourse.julialang.org/t/anova-and-tukeyhsd/89750 "2022-11-04T13:53:07Z")

</div>

I am interested in analysis of variance (ANOVA) and Hierarchical Multiple Comparison Test (TukeyHSD). Where can I find examples and theoretical reference with the Julia language?

---

## [GLM with multiplicative coefficients](https://discourse.julialang.org/t/glm-with-multiplicative-coefficients/88995)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 2\
**Last updated:** [October 29, 2022, 9:56am UTC](https://discourse.julialang.org/t/glm-with-multiplicative-coefficients/88995 "2022-10-29T09:56:42Z")

</div>

Let’s say I’ve got this dataset, where I’m interested in Weight Gain as a function of calories consumed at Breakfast, Lunch, Dinner. 4×6 DataFrame Row │ Participant Day B L D WG │ String …

---

## [Joint longitudinal + time-to-event modelling in Julia?](https://discourse.julialang.org/t/joint-longitudinal-time-to-event-modelling-in-julia/89388)

<div class="topic-metadata">

**Author:** [@danielinteractive](https://discourse.julialang.org/u/danielinteractive)\
**Replies:** 3\
**Last updated:** [October 28, 2022, 8:49am UTC](https://discourse.julialang.org/t/joint-longitudinal-time-to-event-modelling-in-julia/89388 "2022-10-28T08:49:33Z")

</div>

Hi everyone, I am new to Julia, and curious if somebody did any work on joint modelling of longitudinal and time-to-event data already and can share any code examples as starting points for me? Thanks, cheers Daniel

---

## [Analysis and Diagnostics for MCMC](https://discourse.julialang.org/t/analysis-and-diagnostics-for-mcmc/3104)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 27\
**Last updated:** [October 24, 2022, 10:05am UTC](https://discourse.julialang.org/t/analysis-and-diagnostics-for-mcmc/3104 "2022-10-24T10:05:44Z")

</div>

Is there a package in Julia similar to the coda package in R? Most of the functions in coda are pretty straightforward, but it’s nice to have a bunch of MCMC diagnostics/analysis functions all grouped together. I see tha…

---

## [Wasserstein distance for histograms](https://discourse.julialang.org/t/wasserstein-distance-for-histograms/89083)

<div class="topic-metadata">

**Author:** [@ignace](https://discourse.julialang.org/u/ignace)\
**Replies:** 2\
**Last updated:** [October 22, 2022, 11:38pm UTC](https://discourse.julialang.org/t/wasserstein-distance-for-histograms/89083 "2022-10-22T23:38:53Z")

</div>

Hello, How can one compute the Wasserstein distance between two histograms. To be clear, what I mean with a histogram is, e.g., the following h : using StatsBase x = randn(10^4) h = fit(Histogram, x) Looking forwar…

---

## [Meaning of \`GLM.lm\` results (\`t\` and \`Pr(\>|t|)\`)](https://discourse.julialang.org/t/meaning-of-glm-lm-results-t-and-pr-t/88042)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 9\
**Last updated:** [October 1, 2022, 4:30pm UTC](https://discourse.julialang.org/t/meaning-of-glm-lm-results-t-and-pr-t/88042 "2022-10-01T16:30:52Z")

</div>

Hi all! This is a very noobish question, I was uncertain if I should put it in “New to Julia” section, so sorry about it. Anyway, when I fit a linear model using the GLM package, like this: using DataFrames using CSV …

[Previous page](https://discourse.julialang.org/c/domain/stats/12.md?page=6)

[Next page](https://discourse.julialang.org/c/domain/stats/12.md?page=8)
