Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: trouble using _n-1


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: trouble using _n-1
Date   Tue, 25 Nov 2008 17:16:11 -0000

This is not the fault of -concord-. 

BTW, please remember that you are asked to explain where user-written
programs you are using come from. -concord- is a user-written program
written by Thomas J. Steichen and myself which you can download from the
Stata Journal site. 

-concord- expects minimally a varlist specifying two (numeric)
variables. The syntax for varlists does not allow expressions like
var1[_n-1]. 

Stata does the best it can to understand your syntax. Its best guess is
that you are trying to specify weights, which you aren't. But it is
right that your syntax is wrong. 

There is no way round this short of cloning -concord- to take your own
desired syntax or creating your own lagged variable upstream of
-concord-. 

Although it is not spelled out in the help file -concord- knows nothing
about any time or space series flavour to your data. In particular, any
confidence intervals or P-values calculated for your data are based on
an assumption of independent observations. Your data presumably show
serial dependence (serial correlation or autocorrelation) and there is
absolutely no adjustment for that in -concord-. I can see no objection
to using -concord- as a source of descriptive statistic(s) but the
smallish amount of inferential machinery it includes just won't carry
across automatically, just as correlations calculated for time series
don't behave in the same way as correlations for independent data. I am
not even aware of any literature on the question, but watch out. 

Nick 
n.j.cox@durham.ac.uk 

Joseph Wagner

I wish to use the program -concord- to perform an interrater reliability

for a rater.  The data is arranged as such:

idcode      date    var1   var2
--------------------------------------------
person1   date    var1   var2
person1   date    var1   var2
person2   date    var1   var2
person2   date    var1   var2


there are too many variables and observations for me to -reshape- wide 
so I thought that I could try this:

bysort idcode date: concord var1 var1[_n-1]      since the data is 
arrayed as pairs of observations which I wish to compare

but instead of working I get the following error: "_n unknown weight
type"

Am I forced to try some sort of piecewise -reshape- (sets of variables) 
or am I just doing this all wrong?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index