{smcl}
{* 02apr2002}{...}
{hline}
help for {hi:variogram}
{hline}

{title:Calculate and plot variogram}

{p 8 27}
{cmdab:variogram}
{it:varname}
[{cmd:,}
    {cmdab:incl:ude}{cmd:(}{it:#}{cmd:)}
    {cmdab:bw:idth}{cmd:(}{it:#}{cmd:)}
    {cmdab:disc:rete}
    {cmdab:sigma2:}{cmd:(}{it:str}{cmd:)}
    {cmdab:rhoofu:}{cmd:(}{it:str}{cmd:)}
]


{title:Description}

{p}If you have not read help for {help xt}, please do so now.

{p} {cmd:variogram} calculates and plots the variogram for the
variable {it:varname} using the time variable in {help tis} and the id
variable {help iis}.  See Diggle, Liang and Zeger (1994, Ch.3).

{p} The default uses the lowess smoother in {help ksm} to regress the
half-squared response differences v_ijk on the time lags u_ijk.

{title:Options}

{p 0 4} {cmd:include(}{it:#}{cmd:)} specifies the maximum value of
v_ijk that is plotted as a function of the total estimated variance.
However, all v_ijk's are used in computing the variogram.  Default is
1.5.

{p 0 4} {cmd:bwidth(}{it:#}{cmd:)} specifies the bandwidth used in the
lowess smooth model fit.  See {help ksm}.  Default is 0.4.

{p 0 4}
{cmd:discrete} requests that an ANOVA model be fitted to the time lags, giving each unique lag its own mean with no smoothing.

{p 0 4}
{cmd:sigma2(}{it:str}{cmd:)} and {cmd:rhoofu(}{it:str}{cmd:)} allow the user 
to specify a value for sigma-squared and an expression for the autocorrelation
rho(u).  The autocorrelation can be an expression in the variable u, which is
the lag.  This allows the user to add model fitted variograms to the 
empirical variogram.

{title:Remarks}

None.

{title:Author}

{p}
Paul Rathouz

{title:Also see}

{p 0 19}On-line:  help for {help xt}, {help ksm}
{p_end}
