{smcl}
{* 25aug2008}{...}
{cmd:help mata mz_stdc()}
{hline}

{title:Title}

{p 4 14 2}
{bf:mz_stdc() -- Calculates the standard deviation of each column of a matrix}


{title:Syntax}

{p 4 23 2}
{it:real matrix}
{cmd:mz_stdc(}{it:x}{cmd:)}


{pstd}
where

{p 12 16 2}
{it:x}:  {it:real matrix}


{title:Description}

{p 4 4 2}
{cmd:mz_stdc()} computes the standard deviation of each column of a matrix and
puts the result in a column vector.


{title:Remarks}

{pstd} Example:

        {com}: x
        {res}       {txt}1   2   3   4
            {c TLC}{hline 17}{c TRC}
          1 {c |}  {res}1   3   5   6{txt}  {c |}
          2 {c |}  {res}4   3   2   1{txt}  {c |}
          3 {c |}  {res}7   5   3   2{txt}  {c |}
          4 {c |}  {res}8   9   0   1{txt}  {c |}
          5 {c |}  {res}4   6   8   9{txt}  {c |}
          6 {c |}  {res}3   2   6   7{txt}  {c |}
          7 {c |}  {res}1   4   5   7{txt}  {c |}
          8 {c |}  {res}7   2   4   6{txt}  {c |}
          9 {c |}  {res}1   4   0   3{txt}  {c |}
          10{c |}  {res}1   4   6   7{txt}  {c |}
            {c BLC}{hline 17}{c BRC}

        {com}: mz_stdc(x)
        {res}      {txt}           1
            {c TLC}{hline 15}{c TRC}
          1 {c |}  {res}2.790858092{txt}  {c |}
          2 {c |}  {res}2.097617696{txt}  {c |}
          3 {c |}  {res}2.643650675{txt}  {c |}
          4 {c |}  {res}2.884826203{txt}  {c |}
            {c BLC}{hline 15}{c BRC}


{title:Conformability}

    {cmd:mz_stdc(}{it:x}{cmd:)}
         {it:x}:  {it:r x c}
    {it:result}:  {it:c x 1}.


{title:Diagnostics}

{p 4 4 2}
{cmd:mz_stdc()} returns an empty column vector if {it:x} is a row vector. In
addition, to compute the standard deviations, {cmd:mz_stdc()} uses N-1 rather
than N as divisor, where N is the number of rows of matrix {it:x}. To convert
to the alternate definition, multiply the output of {cmd:mz_stdc()} by 
sqrt((N-1)/N).


{title:Source code}

{p 4 4 2}
{help ltimbimata_source##mz_stdc:mz_stdc.mata}


{title:Author}

{p 4 4 2} Diallo Ibrahima Amadou, {browse "mailto:zavren@gmail.com":zavren@gmail.com}


{title:Also see}

{p 4 13 2}
Online:  help for {bf:{help mf_variance:[M-5] variance()}}, {bf:{help ltimbimata}}
{p_end}