# Statistics

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

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

**Page:** 19

---

## [How to change the type of a variable for a loaded table?](https://discourse.julialang.org/t/how-to-change-the-type-of-a-variable-for-a-loaded-table/32973)

<div class="topic-metadata">

**Author:** [@kai](https://discourse.julialang.org/u/kai)\
**Replies:** 11\
**Last updated:** [January 6, 2020, 9:34pm UTC](https://discourse.julialang.org/t/how-to-change-the-type-of-a-variable-for-a-loaded-table/32973 "2020-01-06T21:34:36Z")

</div>

I’m trying to use JuliaDB to load tables and then use MixedModels to fit models. The MixedModels package requires the clustering variable “id” to be categorical, but in my dataset “id” is integer. So my question is, ho…

---

## [Complex Uniform Distribution between 1+0im and 2+0im](https://discourse.julialang.org/t/complex-uniform-distribution-between-1-0im-and-2-0im/32831)

<div class="topic-metadata">

**Author:** [@Amin\_Yahyaabadi](https://discourse.julialang.org/u/Amin_Yahyaabadi)\
**Replies:** 7\
**Last updated:** [January 2, 2020, 9:11am UTC](https://discourse.julialang.org/t/complex-uniform-distribution-between-1-0im-and-2-0im/32831 "2020-01-02T09:11:23Z")

</div>

I am trying to extend Uniform so rand can generate random numbers for Complex types (to test IntelVectorMath library for Complex types) # zeros like syntax function Distributions.Uniform(::Type{T}, a, b) where {T \<: Rea…

---

## [Distributions.jl is there a deterministic distribution?](https://discourse.julialang.org/t/distributions-jl-is-there-a-deterministic-distribution/32475)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 4\
**Last updated:** [December 19, 2019, 1:18pm UTC](https://discourse.julialang.org/t/distributions-jl-is-there-a-deterministic-distribution/32475 "2019-12-19T13:18:37Z")

</div>

I’m working with a structure that has a Distribution field. However I would like it to be able to also take a fixed value without the need to make a Union{Distribution,Real} field type. I think the Dirac distribution doe…

---

## [\[RFC\] Taking directional/orientational statistics seriously](https://discourse.julialang.org/t/rfc-taking-directional-orientational-statistics-seriously/31951)

<div class="topic-metadata">

**Author:** [@sethaxen](https://discourse.julialang.org/u/sethaxen)\
**Replies:** 20\
**Last updated:** [December 13, 2019, 11:30pm UTC](https://discourse.julialang.org/t/rfc-taking-directional-orientational-statistics-seriously/31951 "2019-12-13T23:30:39Z")

</div>

To my knowledge, there are no Julia packages with good support for directional and orientational statistics. Directional statistics is used in biology (especially structural biology), crystallography, astronomy, and vari…

---

## [Is it possible to put weights on clusters in MixedModels.jl?](https://discourse.julialang.org/t/is-it-possible-to-put-weights-on-clusters-in-mixedmodels-jl/32216)

<div class="topic-metadata">

**Author:** [@kai](https://discourse.julialang.org/u/kai)\
**Replies:** 0\
**Last updated:** [December 13, 2019, 12:00am UTC](https://discourse.julialang.org/t/is-it-possible-to-put-weights-on-clusters-in-mixedmodels-jl/32216 "2019-12-13T00:00:25Z")

</div>

The package currently supports “case weights” - weights on individual observations. I wonder if there is a way to tweak the code so that I can put weights on clusters? Specifically, the package currently can take a vect…

---

## [RCall : how to get values of a R object?](https://discourse.julialang.org/t/rcall-how-to-get-values-of-a-r-object/31925)

<div class="topic-metadata">

**Author:** [@Fred](https://discourse.julialang.org/u/Fred)\
**Replies:** 4\
**Last updated:** [December 7, 2019, 10:30am UTC](https://discourse.julialang.org/t/rcall-how-to-get-values-of-a-r-object/31925 "2019-12-07T10:30:24Z")

</div>

Hi, Some R functions retrieve many statistical parameters such as pvalue, confidence interval etc… I would like to know how it is possible to extract those parameters from a R object ? For example here how can I get pva…

---

## [Simplifying Distributions type hierarchy](https://discourse.julialang.org/t/simplifying-distributions-type-hierarchy/31882)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 14\
**Last updated:** [December 6, 2019, 3:21pm UTC](https://discourse.julialang.org/t/simplifying-distributions-type-hierarchy/31882 "2019-12-06T15:21:56Z")

</div>

In probabilistic programming, we use a a lot of distributions. In some settings, it’s important for it to be very easy to define new distributions, and to reason about them. The current type of a Distribution or Samplea…

---

## [(Efficient) function to create a Histogram incrementally without plotting it?](https://discourse.julialang.org/t/efficient-function-to-create-a-histogram-incrementally-without-plotting-it/31651)

<div class="topic-metadata">

**Author:** [@Massimiliano\_Comin](https://discourse.julialang.org/u/Massimiliano_Comin)\
**Replies:** 2\
**Last updated:** [November 29, 2019, 4:26pm UTC](https://discourse.julialang.org/t/efficient-function-to-create-a-histogram-incrementally-without-plotting-it/31651 "2019-11-29T16:26:42Z")

</div>

Hello, I have many random vectors (all of the same nature/size of course) that I want to bin inside a fixed histogram. So basically I would like to incrementally fill a histogram without plotting it, in an efficient fas…

---

## [How to extract the Standard Deviation out of Turing.jl](https://discourse.julialang.org/t/how-to-extract-the-standard-deviation-out-of-turing-jl/31519)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 3\
**Last updated:** [November 27, 2019, 12:35am UTC](https://discourse.julialang.org/t/how-to-extract-the-standard-deviation-out-of-turing-jl/31519 "2019-11-27T00:35:18Z")

</div>

I am trying to extract the Standard Deviation out of Turing for the parameter p but it kept giving me an error. I was tired and frustrated and I could not think straight. I guess I need to take a break. The guide here …

---

## [Statistic for differentiating two distributions?](https://discourse.julialang.org/t/statistic-for-differentiating-two-distributions/31492)

<div class="topic-metadata">

**Author:** [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Replies:** 6\
**Last updated:** [November 25, 2019, 3:35pm UTC](https://discourse.julialang.org/t/statistic-for-differentiating-two-distributions/31492 "2019-11-25T15:35:32Z")

</div>

I need some advice on choosing a proper statistical test for project I will be starting soon. My expectation is that the data will consist of two distinct datasets with similar (normal?) distributions, but different mean…

---

## [Bayesian Analysis of Weighted Parameter](https://discourse.julialang.org/t/bayesian-analysis-of-weighted-parameter/31372)

<div class="topic-metadata">

**Author:** [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Replies:** 10\
**Last updated:** [November 25, 2019, 6:41am UTC](https://discourse.julialang.org/t/bayesian-analysis-of-weighted-parameter/31372 "2019-11-25T06:41:34Z")

</div>

I am interested in analyzing the posterior distribution of a Bernoulli parameter, weighted by given amounts. A simple example: weights = \[100, 50 , 50, 150, 200 \] trials = \[1, 0, 0, 1, 0 \] q\_weghted = sum(weights .\* …

---

## [StatsPlots, precompiling error](https://discourse.julialang.org/t/statsplots-precompiling-error/31354)

<div class="topic-metadata">

**Author:** [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Replies:** 0\
**Last updated:** [November 21, 2019, 7:20pm UTC](https://discourse.julialang.org/t/statsplots-precompiling-error/31354 "2019-11-21T19:20:43Z")

</div>

Hi, I am currently experimenting with my nVIDIA Jetson Nano and have had no problems so far. Now I want to use StatsPlots in addition to PLots, but for StastPlots it is noted in the precompiling phase that the Arpack pa…

---

## [(Kolmogorov-) Lilliefors (K-L) distribution](https://discourse.julialang.org/t/kolmogorov-lilliefors-k-l-distribution/31086)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [November 14, 2019, 8:33pm UTC](https://discourse.julialang.org/t/kolmogorov-lilliefors-k-l-distribution/31086 "2019-11-14T20:33:32Z")

</div>

Hello, does any Julia packages provides the (Kolmogorov-)Lilliefors distribution ? This should be used in hypothesis testing when we want to perform a goodness of fit test against a generic probability family, once we h…

---

## [Can't get quantiles of the Kolmogorov-Smirnov (KSDist) distribution](https://discourse.julialang.org/t/cant-get-quantiles-of-the-kolmogorov-smirnov-ksdist-distribution/31065)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [November 14, 2019, 4:31am UTC](https://discourse.julialang.org/t/cant-get-quantiles-of-the-kolmogorov-smirnov-ksdist-distribution/31065 "2019-11-14T04:31:59Z")

</div>

I am trying to replicate this table (from the MITx course in “Fundamental of statistics”): I can get the cdf, but not the quantiles. For example, for n=7: julia\> using Distributions julia\> KSd = KSDist(7) KSDist(n=7…

---

## [StatsModels not adapted yet?](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342)

<div class="topic-metadata">

**Author:** [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Replies:** 13\
**Last updated:** [November 13, 2019, 5:36pm UTC](https://discourse.julialang.org/t/statsmodels-not-adapted-yet/30342 "2019-11-13T17:36:17Z")

</div>

So far I have estimated data (Rotwein / red wine) in the form of a DataFrame in this form a linear model (using GLM): LinReg = lm(@formula(quality ~ alcohol), Rotwein) quality and alcohol are values within the DataFram…

---

## [Predict or parametric bootstrap for a generalized mixed model](https://discourse.julialang.org/t/predict-or-parametric-bootstrap-for-a-generalized-mixed-model/30855)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 2\
**Last updated:** [November 12, 2019, 7:43am UTC](https://discourse.julialang.org/t/predict-or-parametric-bootstrap-for-a-generalized-mixed-model/30855 "2019-11-12T07:43:43Z")

</div>

I want to fit a generalized mixed model to a dataset where the dependent variable is velocity (continuous positive numbers), the random variable is the subject ID, and the predictor is distance to some point (also a cont…

---

## [Multinomial accepts wrong parameters](https://discourse.julialang.org/t/multinomial-accepts-wrong-parameters/30917)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [November 10, 2019, 8:00pm UTC](https://discourse.julialang.org/t/multinomial-accepts-wrong-parameters/30917 "2019-11-10T20:00:35Z")

</div>

Distributions.Multinomial seems to accept a vector of probabilities that doesn’t sum to one, even if in the code reported in the documentation it should have ckeck\_args true by default. Why is that ? using Distributions…

---

## [Rolling Sum](https://discourse.julialang.org/t/rolling-sum/30793)

<div class="topic-metadata">

**Author:** [@ggjp](https://discourse.julialang.org/u/ggjp)\
**Replies:** 28\
**Last updated:** [November 7, 2019, 2:45pm UTC](https://discourse.julialang.org/t/rolling-sum/30793 "2019-11-07T14:45:36Z")

</div>

What is the recommended way of doing a rolling / moving sum? I’ve found packages RollingFunctions.jl and MarketTechnicals.jl, but neither has this.

---

## [Plot the Histogram of given data (txt. file with 3 columns)](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621)

<div class="topic-metadata">

**Author:** [@Haider17233](https://discourse.julialang.org/u/Haider17233)\
**Replies:** 5\
**Last updated:** [November 3, 2019, 8:51am UTC](https://discourse.julialang.org/t/plot-the-histogram-of-given-data-txt-file-with-3-columns/30621 "2019-11-03T08:51:09Z")

</div>

Histogram of the absolute frequencies (use classes of width 0.5°C) and additional plot with the histogram of the relative frequencies. Please plot the relative frequencies of the temperatures in the month October over t…

---

## [Problem with the positivedefinitivenesse of a kernel matrix](https://discourse.julialang.org/t/problem-with-the-positivedefinitivenesse-of-a-kernel-matrix/28976)

<div class="topic-metadata">

**Author:** [@Ujku\_KU](https://discourse.julialang.org/u/Ujku_KU)\
**Replies:** 8\
**Last updated:** [October 29, 2019, 2:37pm UTC](https://discourse.julialang.org/t/problem-with-the-positivedefinitivenesse-of-a-kernel-matrix/28976 "2019-10-29T14:37:51Z")

</div>

Hi guys, I am trying to generate a positive definite kernel matrix. Below is the minimalistic code: julia\> using MultivariateStats, ForwardDiff, StatsBase, MLKernels, LinearAlgebra, Optim, Plots, Distributions, Forwar…

---

## [Improving Distributions.jl type consistency](https://discourse.julialang.org/t/improving-distributions-jl-type-consistency/30082)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 2\
**Last updated:** [October 21, 2019, 1:49pm UTC](https://discourse.julialang.org/t/improving-distributions-jl-type-consistency/30082 "2019-10-21T13:49:13Z")

</div>

The rand(dist, n::Int) method is really handy, but there’s a lot of irregularity in the type that’s returned. Ideally we’d have some type A with typeof(rand(dist, n::Int)) == A{typeof(rand(dist)), n} Having an identity…

---

## [Turing.jl - NUTS/sample parameters](https://discourse.julialang.org/t/turing-jl-nuts-sample-parameters/30058)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [October 19, 2019, 1:54am UTC](https://discourse.julialang.org/t/turing-jl-nuts-sample-parameters/30058 "2019-10-19T01:54:25Z")

</div>

Hello, I’m trying to learn Turing.jl and the concepts behind it and I’m not seeing any documentation that explains what the parameters are that are passed to NUTS() when sampling. The documentation utilizes the NUTS sam…

---

## [Univariate linear regression with each covariate of dataframe](https://discourse.julialang.org/t/univariate-linear-regression-with-each-covariate-of-dataframe/29951)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 5\
**Last updated:** [October 15, 2019, 7:16pm UTC](https://discourse.julialang.org/t/univariate-linear-regression-with-each-covariate-of-dataframe/29951 "2019-10-15T19:16:47Z")

</div>

I have a dataframe with 5 covariates X1, X2, X3, X4, X5 and a dependent variable Y. I have to perform a univariate regression of Y on each covariate. I don’t want to do using GLM lm(@formula(Y~X1), data) lm(@formula(Y~X…

---

## [Repeated measures 2 way ANOVA](https://discourse.julialang.org/t/repeated-measures-2-way-anova/375)

<div class="topic-metadata">

**Author:** [@grero](https://discourse.julialang.org/u/grero)\
**Replies:** 4\
**Last updated:** [October 11, 2019, 3:02pm UTC](https://discourse.julialang.org/t/repeated-measures-2-way-anova/375 "2019-10-11T15:02:23Z")

</div>

Hi group, I was wondering if anyone has julia code that can do repeated measures 2 way ANOVA? In the past, I’ve used the GLM package to do 2 way ANOVA, but it’s not clear to me how I would approach a repeated measures d…

---

## [DBSCAN using Hamming Distance Metric](https://discourse.julialang.org/t/dbscan-using-hamming-distance-metric/29606)

<div class="topic-metadata">

**Author:** [@Mohamed\_Ismail](https://discourse.julialang.org/u/Mohamed_Ismail)\
**Replies:** 0\
**Last updated:** [October 7, 2019, 4:49pm UTC](https://discourse.julialang.org/t/dbscan-using-hamming-distance-metric/29606 "2019-10-07T16:49:50Z")

</div>

I would like to use Clustering.DBSCAN and specify my own distance metric. Specifically, I want to use Hamming distance. The current DBSCAN interfaces do not seem to provide such option? Is there a workaround for this? …

---

## [SimpleANOVA v0.4.0](https://discourse.julialang.org/t/simpleanova-v0-4-0/28661)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 1\
**Last updated:** [October 3, 2019, 5:28pm UTC](https://discourse.julialang.org/t/simpleanova-v0-4-0/28661 "2019-10-03T17:28:01Z")

</div>

Just putting out a new version of my SimpleANOVA package, now with Levene’s test baked in. Just waiting for the registry merge. https://github.com/BioTurboNick/SimpleANOVA.jl Use at own risk, but I’m using it for my ow…

---

## [How to build a Cointegration model in Julia?](https://discourse.julialang.org/t/how-to-build-a-cointegration-model-in-julia/29292)

<div class="topic-metadata">

**Author:** [@yw892](https://discourse.julialang.org/u/yw892)\
**Replies:** 1\
**Last updated:** [October 2, 2019, 8:02am UTC](https://discourse.julialang.org/t/how-to-build-a-cointegration-model-in-julia/29292 "2019-10-02T08:02:20Z")

</div>

Is there any stable package that could build a cointegration or VECM model? Thanks!

---

## [Convenient way to generate all interaction terms up to a specified order](https://discourse.julialang.org/t/convenient-way-to-generate-all-interaction-terms-up-to-a-specified-order/25537)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 2\
**Last updated:** [September 28, 2019, 9:27am UTC](https://discourse.julialang.org/t/convenient-way-to-generate-all-interaction-terms-up-to-a-specified-order/25537 "2019-09-28T09:27:19Z")

</div>

Given 4 variables, is there a convenient way to generate a formula with all main effects and all interactions up to 3-way interactions? I believe in R it would be ~(b+c+d+e)^3. In julia that syntax appears to be interp…

---

## [ModelFrame contrast & factors in StatsModels in v"0.6.x"](https://discourse.julialang.org/t/modelframe-contrast-factors-in-statsmodels-in-v-0-6-x/28272)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 5\
**Last updated:** [September 28, 2019, 9:25am UTC](https://discourse.julialang.org/t/modelframe-contrast-factors-in-statsmodels-in-v-0-6-x/28272 "2019-09-28T09:25:21Z")

</div>

Hello! I’m confused. In StatsModels 0.5.0 i can get contrasts levels simply: ModelFrame.contrasts\[:name\].levels How can I do it now? And how can i get predictors list?

---

## [Is it really possible for rand to throw a zero?](https://discourse.julialang.org/t/is-it-really-possible-for-rand-to-throw-a-zero/28505)

<div class="topic-metadata">

**Author:** [@aerdely](https://discourse.julialang.org/u/aerdely)\
**Replies:** 61\
**Last updated:** [September 18, 2019, 9:41am UTC](https://discourse.julialang.org/t/is-it-really-possible-for-rand-to-throw-a-zero/28505 "2019-09-18T09:41:23Z")

</div>

rand documentation says it draws iid uniformly distributed values in the half-open unit interval \[0,1) which includes zero but… Is rand ever throwing a zero? I have tried several times with minimum(rand(1\_000\_000\_000)) a…

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

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