Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Interactions in xreg


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Interactions in xreg
Date   Mon, 23 Aug 2010 08:40:23 +0000 (GMT)

--- On Mon, 23/8/10, Morten Hesse <mh@crf.au.dk> wrote:
> I have data, where subjects are tested in 5 blocks.
> Subjects vary on  variable "ant" (dummy coded). I want
> to test of there is a curvi-linear effect of "ant" on
> outcome igt.
> blocksq=block^2 (to test curvi-linearity).

This really depends on what is in your variable block.
If I see a variable names block I will by default assume
that it is categorical. In that case, computing the 
square of that variable makes no sense. It could be an
ordinal variable. In that case computing the square
still makes no sense. You can only compute the square
if you believe the values that the variable block can 
take also gives you information on the distances between
the categories. Stata obviously cannot see what you 
believe, so it will alow you to compute a square of 
any variable, regardelss of whether that makes sense
or not.

If block is categorical or ordinal you must enter it
as a categorical variable, e.g.:

xtreg igt i.ant#i.block age gender, mle

assuming you have Stata 11.

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   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   |   Site index