Re: [R] Hypothesis Testing using Wald Criterion for two regression models with dummy variables

2012-05-02 Thread peter dalgaard

On May 2, 2012, at 15:48 , meredith wrote:

> Peter-
>  Maybe I have not articulately my problem clearly, I have had local help
> with the statistical part just trying to figure out how to correctly program
> this test.  For clarity's sake, I have months worth of data, I want to
> potentially combine those months into four, shall we say seasons, that have
> close to the same behaviour.  Therefore to do this, I am trying a monthly
> moving window to categorize these seasons.  After talking to a couple water
> resources statisician's we decided the way to test if the months are
> different is through the use of hypothesis testing and a dummy variable. So
> I have one regression, Model A, that includes a zero in the dummy spot with
> the two months of data combined, then I have another regression, Model B,
> that includes the interaction term for the changes between the months (the
> intercept changes, using a 0 or 1 dummy variable). Now we discussed running
> a Wald testing, Chi squared, to test to see if the interaction term is of
> importance probability wise, can I do this utilizing anova? Does this make
> more sense?  Then I will run another set of restricted and unrestricted
> models to account for potential differences in the mean (i.e the slope).
> Does this explain my problem better?

Not really. It does indicate that Bert is right, though: You need to enlist a 
local statistician. There are things clearly not understood, which we cannot 
help you with on this list. 

-pd

PS. This is a mailing list. Please quote context.

> 
> Meredith
> 
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Hypothesis-Testing-using-Wald-Criterion-for-two-regression-models-with-dummy-variables-tp4601582p4603260.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Hypothesis Testing using Wald Criterion for two regression models with dummy variables

2012-05-02 Thread meredith
Peter-
  Maybe I have not articulately my problem clearly, I have had local help
with the statistical part just trying to figure out how to correctly program
this test.  For clarity's sake, I have months worth of data, I want to
potentially combine those months into four, shall we say seasons, that have
close to the same behaviour.  Therefore to do this, I am trying a monthly
moving window to categorize these seasons.  After talking to a couple water
resources statisician's we decided the way to test if the months are
different is through the use of hypothesis testing and a dummy variable. So
I have one regression, Model A, that includes a zero in the dummy spot with
the two months of data combined, then I have another regression, Model B,
that includes the interaction term for the changes between the months (the
intercept changes, using a 0 or 1 dummy variable). Now we discussed running
a Wald testing, Chi squared, to test to see if the interaction term is of
importance probability wise, can I do this utilizing anova? Does this make
more sense?  Then I will run another set of restricted and unrestricted
models to account for potential differences in the mean (i.e the slope).
Does this explain my problem better?

Meredith

--
View this message in context: 
http://r.789695.n4.nabble.com/Hypothesis-Testing-using-Wald-Criterion-for-two-regression-models-with-dummy-variables-tp4601582p4603260.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Hypothesis Testing using Wald Criterion for two regression models with dummy variables

2012-05-02 Thread Bert Gunter
Meredith:

You are clearly out of your depth. Get local help. R-help is, err,
an R help list, not a resource for remote statistical consulting.
Although, I admit, there is often some overlap.

-- Bert

On Wed, May 2, 2012 at 5:58 AM, peter dalgaard  wrote:
>
> On May 1, 2012, at 22:01 , meredith wrote:
>
>> I have two models, controlled by dummy variables to see if the models can be
>> combined into one model with similar intercepts and slopes. Has anyone tried
>> to conduct this type of test in R. I am utilizing the econometric idea of
>> hypothesis testing through the hypothesis of coincidence. I have tried to
>> run an anova with test of Chisq, but I am not sure what the results are
>> telling. In addition, I used the rms package with a lrm model in an anova
>> test, again I am not sure what the results are telling me:
>> 
>> Can anyone help me with this?
>
> Not unless you say what you are trying to do... As far as I can tell, you are 
> (A) using a chi-square test for a standard linear model (Gaussian response) 
> and (B) fitting a logistic regression model to the same response, which 
> assumes that it is a proportion or binary response. Neither makes any sense 
> to me.
>
> --
> Peter Dalgaard, Professor
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: pd@cbs.dk  Priv: pda...@gmail.com
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Hypothesis Testing using Wald Criterion for two regression models with dummy variables

2012-05-02 Thread peter dalgaard

On May 1, 2012, at 22:01 , meredith wrote:

> I have two models, controlled by dummy variables to see if the models can be
> combined into one model with similar intercepts and slopes. Has anyone tried
> to conduct this type of test in R. I am utilizing the econometric idea of
> hypothesis testing through the hypothesis of coincidence. I have tried to
> run an anova with test of Chisq, but I am not sure what the results are
> telling. In addition, I used the rms package with a lrm model in an anova
> test, again I am not sure what the results are telling me:
> 
> Can anyone help me with this?

Not unless you say what you are trying to do... As far as I can tell, you are 
(A) using a chi-square test for a standard linear model (Gaussian response) and 
(B) fitting a logistic regression model to the same response, which assumes 
that it is a proportion or binary response. Neither makes any sense to me. 

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Hypothesis Testing using Wald Criterion for two regression models with dummy variables

2012-05-01 Thread meredith
I have two models, controlled by dummy variables to see if the models can be
combined into one model with similar intercepts and slopes. Has anyone tried
to conduct this type of test in R. I am utilizing the econometric idea of
hypothesis testing through the hypothesis of coincidence. I have tried to
run an anova with test of Chisq, but I am not sure what the results are
telling. In addition, I used the rms package with a lrm model in an anova
test, again I am not sure what the results are telling me:

Try 1
anova(H,Ha,test="Chi")
Analysis of Variance Table

Model 1: logload ~ logflow
Model 2: logload ~ dummy + logflow
  Res.DfRSS Df Sum of Sq  Pr(>Chi)
1 17 4.6742   
2 16 2.6314  12.0428 0.0004245 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Try 2:
fit<-lrm(logload~logflow+dummy)
> anova(fit)
Wald Statistics  Response: logload 

 Factor Chi-Square d.f. P 
 logflow17.56  1<.0001
 dummy   5.22  10.0224
 TOTAL  18.03  20.0001

Can anyone help me with this?
Thanks!

--
View this message in context: 
http://r.789695.n4.nabble.com/Hypothesis-Testing-using-Wald-Criterion-for-two-regression-models-with-dummy-variables-tp4601582.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.