understanding durbin-watson test in R

0 votes
I believe I have a misconception about how the dwtest function in the R lmtest package.

> dwtest(lm(r2 r1)) > r1 - runif(1000, 0.0, 1.0) > r2 - runif(1000, 0.0, 1.0)

Test of Durbin-Watson

lm(r2 r1) data
p-value = 0.3789, DW = 1.9806
a different perspective: real autocorrelation is higher than 0.

R2 - seq(0, 1000, by=1) > dwtest(lm(r2 r1)) > > r1 - seq(0, 1000, by=1)

Test of Durbin-Watson

lm(r2 r1) data
p-value = 0.8352; DW = 2.2123
When I'm certain I've understood everything, I first compare two sets of random integers to one another (which do not correlate - correct)

Then, I link the incrementing numbers from 1 to 1000 with themselves (which does not correlate - uhm... what)

Can someone please show out the obvious mistake I make?
Jun 24, 2022 in Data Science by Sohail
• 3,040 points
540 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Data Science

0 votes
0 answers

Understanding `scale` in R

I'm attempting to comprehend R's definition of ...READ MORE

Jul 6, 2022 in Data Science by avinash
• 1,840 points
506 views
0 votes
0 answers

Understanding of minbucket function in CART model using R

Let's say that the training data is ...READ MORE

Jul 20, 2022 in Data Science by avinash
• 1,840 points
573 views
0 votes
0 answers

What does R assume regarding order in paired t-test?

I'm assuming that the data are assumed ...READ MORE

Jul 22, 2022 in Data Science by avinash
• 1,840 points
1,336 views
0 votes
0 answers

Introduction to Statistical Learning with Applications in R Figure Codes

I recently bought the following book: An Introduction ...READ MORE

Jun 1, 2022 in Data Science by avinash
• 1,840 points
562 views
0 votes
1 answer

Difference between the == and %in% operators in R

percent in percent "returns a vector of ...READ MORE

answered Jun 20, 2022 in Data Science by Sohail
• 3,040 points
723 views
0 votes
1 answer

Difference between the == and %in% operators in R

According to help('percent in percent'), percent in ...READ MORE

answered Jun 23, 2022 in Data Science by Sohail
• 3,040 points
496 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,570 points
1,030 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
1,178 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
5,890 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
1,112 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP