Below is a snapshot of the Web page as it appeared on 4/9/2011 (the last time our crawler visited it). This is the version of the page that was used for ranking your search results. The page may have changed since we last cached it. To see what might have changed (without the highlights), go to the current page.
Bing is not responsible for the content of this page.
APBRmetrics :: View topic - Calculating adjusted plus/minus
APBRmetrics Forum Index APBRmetrics
The statistical revolution will not be televised.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Calculating adjusted plus/minus
Goto page 1, 2  Next
 
Post new topic   Reply to topic    APBRmetrics Forum Index -> General discussion
View previous topic :: View next topic  
Author Message
Eli W



Joined: 01 Feb 2005
Posts: 402

PostPosted: Sun Jun 01, 2008 11:14 pm    Post subject: Calculating adjusted plus/minus Reply with quote

I finally took a stab at calculating adjusted plus/minus on my own, and it wasn't as hard as I anticipated. I wrote up some instructions partly as a reminder to myself for the future, and partly because I thought some other adventurous souls might be interested in calculating it on their own. But be warned - you need a pretty fast computer and Excel 2007 (it can probably be done with some other programs but the method I describe won't work with Excel 2003 because of its column limit).

http://www.countthebasket.com/blog/2008/06/01/calculating-adjusted-plus-minus/
_________________
Eli W. (formerly John Quincy)
CountTheBasket.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mountain



Joined: 13 Mar 2007
Posts: 1527

PostPosted: Mon Jun 02, 2008 11:56 am    Post subject: Reply with quote

Now that you have the method down, do you think you will apply the full measure of it to calculating adjusted +/- for lineups (or pairs or triplets) eventually?
Back to top
View user's profile Send private message
Eli W



Joined: 01 Feb 2005
Posts: 402

PostPosted: Mon Jun 02, 2008 2:01 pm    Post subject: Reply with quote

Probably.
_________________
Eli W. (formerly John Quincy)
CountTheBasket.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ben



Joined: 13 Jan 2005
Posts: 266
Location: Iowa City

PostPosted: Tue Jun 03, 2008 1:24 am    Post subject: Reply with quote

That's great! I'm looking forward to see what you do with it.
Back to top
View user's profile Send private message
Eli W



Joined: 01 Feb 2005
Posts: 402

PostPosted: Tue Jun 03, 2008 11:15 pm    Post subject: Reply with quote

I think I was able to replicate Dan's method for splitting things up into offensive and defensive adjusted plus/minus:

http://www.countthebasket.com/blog/2008/06/03/offensive-and-defensive-adjusted-plus-minus/
_________________
Eli W. (formerly John Quincy)
CountTheBasket.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mountain



Joined: 13 Mar 2007
Posts: 1527

PostPosted: Wed Jun 04, 2008 12:26 am    Post subject: Reply with quote

Thank you.
Back to top
View user's profile Send private message
Ben



Joined: 13 Jan 2005
Posts: 266
Location: Iowa City

PostPosted: Wed Jun 04, 2008 10:57 am    Post subject: Reply with quote

I don't know if this data would be of use to you, but it's nice to have available:

http://www.draftexpress.com/nba-pre-draft-measurements/?year=2008&sort2=ASC&draft=0&sort=
Back to top
View user's profile Send private message
Ilardi



Joined: 15 May 2008
Posts: 265
Location: Lawrence, KS

PostPosted: Wed Jun 04, 2008 1:46 pm    Post subject: Reply with quote

Eli W wrote:
I think I was able to replicate Dan's method for splitting things up into offensive and defensive adjusted plus/minus:

http://www.countthebasket.com/blog/2008/06/03/offensive-and-defensive-adjusted-plus-minus/


That's some very nice work. I had a similar method in mind for the offensive/defensive splits when Aaron B. and I work on them later this summer, but also plan to try instead a multivariate regression approach - i.e., one that models offensive and defensive efficiency as simultaneous dependent variables (that is, two dv's in the same model). That would seem to have the advantage of parsimony (one step) and would provide a direct estimate of the error term for each component, and I can't really think of a downside, can you?
Back to top
View user's profile Send private message
Scott S



Joined: 10 Feb 2008
Posts: 46
Location: East Rutherford, NJ

PostPosted: Sun Jul 06, 2008 8:15 pm    Post subject: Reply with quote

I can't seem to get my csv file to import into R. Every time I try it gives me the following message:
Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
cannot open file 'doc/adj0708.csv': No such file or directory

I have R-2.7.1 and have tried saving the csv file in many of the folders in the "R-2.7.1" folder and changed the name in my command accordingly for each (The file for the above command was saved in the location "C:\Program Files\R\R-2.7.1\doc". There was no "files" folder I could find in this version.) If it isn't obvious already, I have never used R before, so I apologize for my ignorance and would greatly appreciate any help or guidance you could offer. Thanks a ton.
Back to top
View user's profile Send private message Visit poster's website
Ed Küpfer



Joined: 30 Dec 2004
Posts: 787
Location: Toronto

PostPosted: Sun Jul 06, 2008 8:20 pm    Post subject: Reply with quote

The easiest way to import data into R from a spreadsheet is to copy the data in the spreadsheet and use this function in R:

Code:
newdata <- read.table('clipboard' , sep=',' , head=T)


Here you are telling R to copy the data from the clipboard. the "sep" part is saying that it is comma seprated data -- when I copy stuff from excel, I write
Code:
sep = "\t"
for tab separated data. The "head=" part is telling R that the column names are in the data (TRUE) or not (FALSE).
_________________
ed
Back to top
View user's profile Send private message Send e-mail
Eli W



Joined: 01 Feb 2005
Posts: 402

PostPosted: Sun Jul 06, 2008 8:35 pm    Post subject: Reply with quote

Hmm, thanks for catching that. I must have created the "files" directory on my own and forgot that it wasn't automatically created when R is installed.

If Ed's method doesn't work I would suggest trying to use the full path to the CSV file, making sure to use forward slashes instead of back-slashes.

Code:
adj0708 <- read.csv(file="c:/directoryname/adj0708.csv")


Another option is to do it in two steps by first setting the working directory where the file is saved and then loading it.

Code:
setwd("c:/directoryname")
adj0708 <- read.csv(file="adj0708.csv")
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gcampbe2



Joined: 08 Jul 2008
Posts: 24
Location: around Detroit, MI

PostPosted: Wed Jul 09, 2008 5:36 pm    Post subject: Eli Reply with quote

great work! enjoy reading a lot of your stuff, Keep up the awesome ideas!
_________________
Al Jefferson: I knew there was a possibility that if I tried to go for the max, I could possibly hurt my teammates down the road...
Back to top
View user's profile Send private message Send e-mail
Ben F.



Joined: 07 Mar 2005
Posts: 391

PostPosted: Thu Jul 17, 2008 4:01 pm    Post subject: Reply with quote

So I decided to try out Eli's method and I run into a problem with R that I wonder if anyone could help me out with: when I paste in the regression formula, it's too long, so it cuts off the lines after a certain amount of characters and then generates errors because of it. For example, it would do something where it would cut off the 0 from the end of one of the player codes, move it to the next line, and then say "Error: unexpected numeric constant in 0".

What am I doing wrong?
Back to top
View user's profile Send private message
Ed Küpfer



Joined: 30 Dec 2004
Posts: 787
Location: Toronto

PostPosted: Thu Jul 17, 2008 4:36 pm    Post subject: Reply with quote

Try pasting the formula into a text editor, then copying that and pasting it into R. R will not cut off lines for length like Excel -- I'm guessing that the cut-off issue is taking place before you get to R.
_________________
ed
Back to top
View user's profile Send private message Send e-mail
Eli W



Joined: 01 Feb 2005
Posts: 402

PostPosted: Thu Jul 17, 2008 4:42 pm    Post subject: Reply with quote

This could be an issue with newer versions of R. When I paste the formula into R 2.5.1 I don't have any issues, but when I do the same in 2.7.1 I encounter the error that you mention. I'm not sure what the solution is.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    APBRmetrics Forum Index -> General discussion All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group