Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: Re: regression using generalized linear model
From
Aidan Trung Nguyen <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: RE: Re: regression using generalized linear model
Date
Thu, 13 Mar 2014 06:52:50 +0000
Thanks Joseph for your input. I will give it a try. The actual model in SAS is:
proc glm data=inputdataset ;
class A B ;
model Y = X*V X*V*V W W*W U*Z S*Z R R*R A*B / solution;
weight regweightannual ;
output out=outputdataset rstudent=var1;
________________________________________
From: [email protected] [[email protected]] on behalf of Joseph Coveney [[email protected]]
Sent: Tuesday, March 11, 2014 9:17 PM
To: [email protected]
Subject: st: Re: regression using generalized linear model
Aidan Trung Nguyen wrote:
I'm trying to write the STATA equivalent of the followingSAS statement:
proc glm data=datasetclass a b model x = v*y*y u*u t a*b
weight w
output out = outputdataset
a is a string character
b, x, v, y, u, t are numeric
u contains non integer and negative values
I tried the below command but without success:anova x v*y*y u*u t a*b
error message : factor variables may not contain non integervalues Any guidance
is much appreciated. Thanks.
--------------------------------------------------------------------------------
Try:
encode a, generate(A) // You knew this already
anova x c.(v#y#y u#u t) A#b aweight[w]
1. In Stata's estimation commands other than-anova-, the default for a predictor
is a continuous variable, and so if you do not use the i. prefix, then it is
assumed not to represent a classification variable. In Stata's -anova-, it is
the opposite for reasons of convention in ANOVA: unless you use the c. prefix,
it is assumed to be a classification (SAS's CLASS) variable. Stata's
classification (factor) variables cannot have noninteger values, just like the
error message said.
2. The OUTPUT statement in the SAS example doesn't specify any diagnostics or
predictions to save. Check your SAS log file for error messages. (I assume
that you omitted all of the semicolons for clarity.) For corresponding
diagnostics, predictions, residuals etc. after Stata's -anova-, see
http://www.stata.com/help.cgi?anova+postestimation
3. You might want to consider your model a little more. As written, it has
polynomial terms without any corresponding regressor terms, and an interaction
term without either of the main effects terms.
4. In SAS, GLM is General Linear Model, not Generalized Linear Model.
Joseph Coveney
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/