LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 4 Dec 2001 09:28:12 -0500
Reply-To:     "Todd, Mike" <todd@PSYCHIATRY.UCHC.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Todd, Mike" <todd@PSYCHIATRY.UCHC.EDU>
Subject:      Re: regression model
Content-Type: text/plain; charset="iso-8859-1"

Angel:

I'm not sure what your exact need is. If you have a simple case where i and j differ by a consistent "distance", then you can use the LAGn function to create an x_j vector from the original x_i scores. A brief example where i - j = 2:

/*CREATING ORIGINAL DATA SET*/ data a; input id y x_i; cards; 01 4 5 02 3 6 03 6 3 04 5 2 05 2 6 ;

/*CREATING DATA SET CONTAINING X_I, X_J, */ /*AND XIXJ = X_I * X_J WHERE I - J = 2 */ data b; set a; x_j = lag2(x_i); xixj = x_i * x_j; run;

This yields a data set that looks like this:

ID Y X_I X_J XIXJ 01 4 5 . . 02 3 6 . . 03 6 7 5 35 04 5 8 6 48 05 2 9 7 63

You can then run a regression model for y_i = b_0 + b_1(x_i * x_j)

like so:

proc reg data=b; model y = x_i x_j xixj; run;

Though, of course, the model here would be based on only the last 3 cases, AND the multiplicative (interaction) term would be highly correlated with its component linear terms (x_i, x_j). Using mean-centered x_i and x_j scores in computing xixj will help with the collinearity issue--send another note if you'd like help with centering.

Hope this helps.

-Mike

------------------------------

Date: Tue, 4 Dec 2001 09:40:07 +0800 From: Angel Sung <angel_sok@HOTMAIL.COM> Subject: regression model

I would like to fit the following model

y_ij = b_0 + b_1(x_i * x_j ) for different i, j

How can SAS do that??

------------------------------

><><><><><><><><><><><><><><><><><><><>< Michael Todd, Ph.D. University of Connecticut Health Center Alcohol Research Center-MC2103 Department of Psychiatry 263 Farmington Avenue Farmington CT 06030-2103

Voice: 860.679.5468 Fax: 860.679.5464 E-mail: todd@psychiatry.uchc.edu


Back to: Top of message | Previous page | Main SAS-L page