# Use of std function in Statistics

**URL:** <https://discourse.julialang.org/t/use-of-std-function-in-statistics/25169>\
**Category:** New to Julia\
**Created:** [June 11, 2019, 9:33pm UTC](https://discourse.julialang.org/t/use-of-std-function-in-statistics/25169 "2019-06-11T21:33:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stu/32/8772_2.png) [@stu](https://discourse.julialang.org/u/stu)\
**Post date:** [June 11, 2019, 9:33pm UTC](https://discourse.julialang.org/t/use-of-std-function-in-statistics/25169/1 "2019-06-11T21:33:08Z")

</div>

I am trying to use [this function](https://docs.julialang.org/en/v1/stdlib/Statistics/index.html)

`	result = Statistics.std(data_data; corrected=true, mean=nothing, 2)`

But this is throwing an error and I do not understand why. Could anyone explain to properly format the parameters for things like this:

```julia
std(v; corrected::Bool=true, mean=nothing, dims)

```

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [June 11, 2019, 9:38pm UTC](https://discourse.julialang.org/t/use-of-std-function-in-statistics/25169/2 "2019-06-11T21:38:44Z")

</div>

Keyword parameters (i.e. arguments appearing after the semi-colon “`;`”) have to be named, which is not the case of `dims` here, for which you directly put the value 2.

This should work:

```julia
julia> data = rand(1000,1000);
julia> using Statistics
julia> result = std(data; corrected=true, mean=nothing, dims=2)
1000×1 Array{Float64,2}:
 0.27789883476970717
 0.2834628928652056 
 0.2843101448288627 
 0.290594711126601  
 ...

```

or, since it looks like you want to keep the default values for `corrected` and `mean`:

```julia
julia> result = std(data; dims=2)
1000×1 Array{Float64,2}:
 0.27789883476970717
 0.2834628928652056 
 0.2843101448288627 
 0.290594711126601  
 ...

```

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [June 12, 2019, 12:02am UTC](https://discourse.julialang.org/t/use-of-std-function-in-statistics/25169/3 "2019-06-12T00:02:33Z")

</div>

Hopefully, you’ve got your answer, but in the future, please provide a minimal working example that demonstrates your problem and shows the error message. [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757)
