Re: [R] Scoring a test set after clustering a training set
Hi Barry, I don't think pam has a way to predict for test observations. However, this questions was asked and answered earlier. The approach is to take the medoids generated in pam and use them in a K-nn algorithm as the training data with K = 1. This way, you can classify your testing data by identifying the closest medoid (and therefore, the cluster it belongs to). Please see the conversation here: https://stat.ethz.ch/pipermail/r-help/2004-January/044511.html Regards, Aaditya On Mon, May 26, 2014 at 12:50 PM, Barry King barry.k...@qlx.com wrote: I have divided my data into a training set and a test set. I have then applied a logistic transformation to the variables in the training set and have used pam to assign the observations to one of four clusters. My question is How do I score the test observations now that I have the training set with clusters? Thank you. -- __ *Barry E. King, Ph.D.* __ [[alternative HTML version deleted]] __ 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. [[alternative HTML version deleted]] __ 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] How to optimize or build a better random forest?
Hello Everyone! It's been a while since I last posted a question! Hope everyone has been doing well! ~~~ CONTEXT ~~~ I have recently entered a beginner-level competition on kaggle. The goal of the competition is to build a model that predicts who did/did not survive on the Titanic. I decided to use random forests as I have been wanting to learn the algorithm and the competition was the perfect impetus. Unfortunately, the model I have built is not very accurate. ~~~ QUESTION ~~~ What can I do to make the model more accurate (less error for 1 (survived))? Is there a cost matrix that I can input into the model? Improve the code? Learn more statistics (please provide resources :) )? ~~~ SOME CODE ~~~ # Response variable: Survived # 0 = Did not survive # 1 = Did survive # First few steps # 1. Used regsubsets to identify the 5 best variables # 2. Cleaned the raw data and built a logistic regression to see the significance of the predictors (and their levels if factor) # 3. Develop a new 'train' dataset with a group of variables based on the significances from the logistic regression # PLEASE FEEL FREE TO SHARE FEATURE SELECTION/EXTRACTION METHODS AS I AM CLEARLY LACKING IN THAT AREA AS WELL :( head(train) survived age sibsp pclass2 pclass3 sexmale 10 22 1 0 1 1 21 38 1 0 0 0 31 26 0 0 1 0 41 35 1 0 0 0 50 35 0 0 1 1 60 27 0 0 1 1 sapply(train,class) survived age sibsp pclass2 pclass3 sexmale factor numeric integer factor factor factor sapply(split(train,train$survived),function(x) dim(x)[1]) 0 1 549 342 rf - randomForest(train[,-1], train[,1], ntree=1,classwt=c(549/891,342/891),importance=TRUE,do.trace=FALSE) OOB estimate of error rate: 17.73% Confusion matrix: 0 1 class.error 0 500 49 0.08925319 1 109 233 0.31871345 [[alternative HTML version deleted]] __ 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] Where to find the p-value of a correlation test
Awesome! cor.text() is what I was looking for! Thank you Duncan! On Wed, Apr 25, 2012 at 9:43 AM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 12-04-25 9:30 AM, Aaditya Nanduri wrote: Hey everyone, I hope this finds you in good cheer. I just have a quick question: What is the function that outputs the p-value for correlation? cor(x,y) only provides the R value. I would like the p-value associated with it. cor(x,y) calculates the correlation, it doesn't perform a test, so there is no p-value. cor.test() performs a test. Duncan Murdoch -- *Aaditya Nanduri | Statistical Analyst*** Business Analytics Aflac Worldwide Headquarters 1932 Wynnton Road, Columbus, Georgia 31999 Tel: 706.596.2986 | Cell: 908.380.4560 [[alternative HTML version deleted]] __ 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] Where to find the p-value of a correlation test
Im sorry. I meant cor.test() On Tue, May 1, 2012 at 6:16 PM, Aaditya Nanduri aaditya.nand...@gmail.comwrote: Awesome! cor.text() is what I was looking for! Thank you Duncan! On Wed, Apr 25, 2012 at 9:43 AM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 12-04-25 9:30 AM, Aaditya Nanduri wrote: Hey everyone, I hope this finds you in good cheer. I just have a quick question: What is the function that outputs the p-value for correlation? cor(x,y) only provides the R value. I would like the p-value associated with it. cor(x,y) calculates the correlation, it doesn't perform a test, so there is no p-value. cor.test() performs a test. Duncan Murdoch -- *Aaditya Nanduri | Statistical Analyst*** Business Analytics Aflac Worldwide Headquarters 1932 Wynnton Road, Columbus, Georgia 31999 Tel: 706.596.2986 | Cell: 908.380.4560 -- *Aaditya Nanduri | Statistical Analyst*** Business Analytics Aflac Worldwide Headquarters 1932 Wynnton Road, Columbus, Georgia 31999 Tel: 706.596.2986 | Cell: 908.380.4560 [[alternative HTML version deleted]] __ 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] Where to find the p-value of a correlation test
Hey everyone, I hope this finds you in good cheer. I just have a quick question: What is the function that outputs the p-value for correlation? cor(x,y) only provides the R value. I would like the p-value associated with it. Thank you all for your help! [[alternative HTML version deleted]] __ 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] R not recognized in command line
It may very well have been an error in the PATH variable. But, I simply deleted the R_HOME variable and also deleted it from the PATH variable. Then I made a new one with the exact same values as before (but it worked this time). R_HOME = C:\Program Files\R\R-2.12.1 path = ...;%R_HOME%\bin\i386;... R is now recognized as a command. Thank you all very much. Im sorry I could not provide a satisfactory solution On Thu, Jan 13, 2011 at 1:12 AM, Daniel Nordlund djnordl...@frontier.comwrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Aaditya Nanduri Sent: Wednesday, January 12, 2011 9:31 PM To: gleyne...@gmail.com gleynes%...@gmail.com Cc: r-help@r-project.org; spec...@stat.berkeley.edu; Uwe Ligges Subject: Re: [R] R not recognized in command line @ Daniel Nordlund : I've also tried the dir that you recommended. R is still not recognized as a command in CMD.exe @ Uwe Ligges : There are no blanks before or after the semicolon. I added them after I copied it so that it would be more legible. And for some of the dir's in the path, having a backslash at the end still works. However, I tried it with and without the backslash for the R_HOME\bin and \bin\i386 folders. Nothing seems to work. @Gene Lynes : I have been using the GUI the whole time so it wasnt too hard changing the path constantly. And I've also set the R_HOME variable as well. I'm starting to regret clearing the partition that had Ubuntu. Life would've been so much easier had I not erased it. I will definitely let you know if I have any breakthroughs. Well, (1) either the path is still not correct, (2) R is not installed where you think it is, or (3) your windows installation is corrupted. (There are probably other options as well. Let's make sure R is installed where you think it is. The default directory for 32-bit R-2.12.1 on Windows (if you accepted the defaults) is C:\Program Files\R\R-2.12.1\bin\i386 So open up a Windows command shell and execute Rterm by typing the full path and filename C:\Program Files\R\R-2.12.1\bin\i386\Rterm.exe Make sure you include the double quotes around the complete path (because of the space in the directory path, and if you changed the installation directory then you obviously would need to change the command). Does R start up? If it does, then you still don't have the correct path stored in the PATH environment variable. If R doesn't start, then it is not installed where you think it is. Let us know your results are. Dan Daniel Nordlund Bothell, WA USA code. __ 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. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] R not recognized in command line
Im sorry for the late reply. The output to echo %PATH% : C:\GTK\bin; C:\Program Files\MiKTeX 2.8\miktex\bin ;C:\Windows\system32 ;C:\Windows ;C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files\MATLAB\R2008a\bin; C:\Program Files\MATLAB\R2008a\bin\win32; C:\Program Fil es\QuickTime\QTSystem\; C:\MinGW\bin;c:\Program Files\Microsoft SQL Server\100\To ols\Binn\; c:\Program Files\Microsoft SQL Server\100\DTS\Binn\; C:\Program Files\ R\R-2.12.1\bin\; C:\Program Files\Python27; C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Python26;C:\Python26\Scripts 2011/1/8 Uwe Ligges lig...@statistik.tu-dortmund.de OK, then let's see if you managed to change the PATH or let is see what is incorrect there. Therefore, please do the following: 1. open a Windows command shell (what you call a DOS window) 2. type echo %PATH% 3. Send us the output. Uwe Ligges On 08.01.2011 19:29, Aaditya Nanduri wrote: Mr. Gregory : I may have to resort to a roundabout method like yours. I just cant seem to make it work. Thank you for your help. Mr. Spector : Everytime I change the path, I closed all the DOS windows. Yet, R is not recognized as a command. Also, I just want to say, you have an awesome last name. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] R not recognized in command line
@ Daniel Nordlund : I've also tried the dir that you recommended. R is still not recognized as a command in CMD.exe @ Uwe Ligges : There are no blanks before or after the semicolon. I added them after I copied it so that it would be more legible. And for some of the dir's in the path, having a backslash at the end still works. However, I tried it with and without the backslash for the R_HOME\bin and \bin\i386 folders. Nothing seems to work. @Gene Lynes : I have been using the GUI the whole time so it wasnt too hard changing the path constantly. And I've also set the R_HOME variable as well. I'm starting to regret clearing the partition that had Ubuntu. Life would've been so much easier had I not erased it. I will definitely let you know if I have any breakthroughs. On Wed, Jan 12, 2011 at 12:20 PM, Gene Leynes gleyne...@gmail.comgleynes%...@gmail.com wrote: Although it could easily be user error, I never got Rpy or Rpy2 working an any sort of reliable way. However I did learn a couple of things about the Windows PATH First, (as others have mentioned) it's easiest to modify the PATH through the Windows GUI that comes up when you right click My Computer, and then you can modify the Environmental Variables somewhere. Second, here are examples of the syntax for adding things to the PATH from a DOS command line path = %PATH%;C:\Program Files\R\R-2.12.1\bin path = %PATH%;C:\Rtools\bin path = %PATH%;C:\Rtools\MinGW\bin path = %PATH%;C:\Rtools\perl\bin set R_HOME = C:\Program Files\R\R-2.12.1\ Third, I found this R command useful for checking the path from within R: Sys.getenv()[['PATH']] On Wed, Jan 12, 2011 at 10:43 AM, Aaditya Nanduri aaditya.nand...@gmail.com wrote: Im sorry for the late reply. The output to echo %PATH% : C:\GTK\bin; C:\Program Files\MiKTeX 2.8\miktex\bin ;C:\Windows\system32 ;C:\Windows ;C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files\MATLAB\R2008a\bin; C:\Program Files\MATLAB\R2008a\bin\win32; C:\Program Fil es\QuickTime\QTSystem\; C:\MinGW\bin;c:\Program Files\Microsoft SQL Server\100\To ols\Binn\; c:\Program Files\Microsoft SQL Server\100\DTS\Binn\; C:\Program Files\ R\R-2.12.1\bin\; C:\Program Files\Python27; C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Python26;C:\Python26\Scripts 2011/1/8 Uwe Ligges lig...@statistik.tu-dortmund.de OK, then let's see if you managed to change the PATH or let is see what is incorrect there. Therefore, please do the following: 1. open a Windows command shell (what you call a DOS window) 2. type echo %PATH% 3. Send us the output. Uwe Ligges On 08.01.2011 19:29, Aaditya Nanduri wrote: Mr. Gregory : I may have to resort to a roundabout method like yours. I just cant seem to make it work. Thank you for your help. Mr. Spector : Everytime I change the path, I closed all the DOS windows. Yet, R is not recognized as a command. Also, I just want to say, you have an awesome last name. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] R not recognized in command line
Mr. Gregory : I may have to resort to a roundabout method like yours. I just cant seem to make it work. Thank you for your help. Mr. Spector : Everytime I change the path, I closed all the DOS windows. Yet, R is not recognized as a command. Also, I just want to say, you have an awesome last name. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] R not recognized in command line
I really appreciate all your help but I've already tried everything that has been suggested. I changed the path to every possible combination that leads to an R executable...and nothing seems to work. I've checked to see that Im typing it right. I've also asked my sister to make sure (a fresh set of eyes is always helpful). The only thing that work are navigating to the folder holding the R executable (R_HOME/bin) and the batchscripts. However, this doesnt help me in working with rpy2. On Wed, Jan 5, 2011 at 9:59 AM, Gabor Grothendieck ggrothendi...@gmail.comwrote: On Wed, Jan 5, 2011 at 10:41 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 11-01-05 8:51 AM, Joshua Wiley wrote: Hi Aaditya, I assume you are running some variant of Windows and by the prompt in DOS you are using cmd.exe. Perhaps you are already, but from your examples it looks like either A) you are not in the same directory as R or B) are not adding the path to R in the command. For example, on Windows I always install R under C:\R\ so for me inside cmd.exe: C:\directory C:\R\R-devel\bin\x64\R [[[R starts here]]] alternately you could switch directories over and then just type R at the console: C:\directory cd C:\R\R-devel\bin\x64\ C:\R\R-devel\bin\x64 R [[[R starts here]]] or since you have set the environment variables: C:\directory %R_HOME%\bin\x64\R [[[R starts here]]] Alternately, edit the PATH environment variable in Windows and add the path to R (i.e., R_HOME\bin\i386\ or whatever it is for you), and you should be able to just enter R at the command prompt and have it start. Editing the PATH is probably the best approach, but a lot of people get it wrong because of misunderstanding how it works: - If you change PATH in one process the changes won't propagate anywhere else, and will be lost as soon as you close that process. That could be a cmd window, or an R session, or just about any other process that lets you change environment variables. - If you want to make global changes to the PATH, you need to do it in the control panel System|Advanced|Environment variables entries. - Often it is good enough to use a more Unix-like approach, and only make the change at startup of the cmd processor. You use the /k option when starting cmd if you want to run something on startup. You can also use Rcmd.bat, R.bat, Rgui.bat, etc. found at http://batchfiles.googlecode.com Just put any you wish to use anywhere on your path and it will work on all cmd instances and will also work when you install a new version of R since it looks up R's location in the registry. -- Statistics Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at 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. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] R not recognized in command line
Hello all, I recently installed rpy2 so that I could use R through Python. However, R was not recognized in the command line. So I decided to add it to the PATH variables. But it just doesnt work And what I mean by it doesnt work is : No matter what I type at the prompt in DOS- be it R, Rcmd, R CMD, Rscript- it is not recognized as a command. Path variables used : 1. %R_HOME% -- C:\Program Files\R\R 2.12.1\ 2. %R_HOME%\bin 3. %R_HOME%\bin\i386 4. Some Batchscripts I found online that recognize the R.exe in \bin\i386 but only if I run the batch file...its not natively recognized (if I were to type 'R' at the prompt in DOS, its not recognized) I would appreciate any help in this matter. Or should I do something else so that I can try rpy2? Python version 2.6.6 R 2.12.1 rpy2 2.0.8 -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] How to do a trig regression
Thank you all very much for your help. Unfortunately I do not have the data to test out the ideas suggested but I was able to find a good approximation using another software package. I will try to get the data for this problem so I can find out how to do it in R as I am very much interested in the process. @Dennis : Indeed, its the c that causes the problem. Without the c, solving this would be a very easy thing. On Mon, Sep 13, 2010 at 12:01 PM, Greg Snow greg.s...@imail.org wrote: Without the square term you can just use the rule for addition in sines: sin(a+b) = sin(a)cos(b) + cos(a)sin(b) So a regression of y= a + b* sin(2*pi/360*x + c) can be fit as: lm( y~ sin( 2*pi/360*x) + cos( 2*pi/360/x ) ) If you need the actual values of b and c then you will need to do a little algebra. The same idea may be sufficient for your formula (or at least a close approximation), or you could switch to nonlinear fits using the nls function and fit your formula directly. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Aaditya Nanduri Sent: Sunday, September 12, 2010 8:23 PM To: r-help@r-project.org Subject: [R] How to do a trig regression Hello All, I cant seem to do a trig regression in R. The equation is as follows : y = a+b*(sin((2*pi*x/360) - c))^2 a, b, c are coefs that I want. y, x are input vectors. The equation I put into R: lm(y ~ sin(2*pi*x/360)^2) This equation is missing the c and I dont get the right answer. Also, I dont know how to plot the lm over the x values instead of the indices. Any help is sincerely appreciated. Thank you all very much. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] How to do a trig regression
Hello All, I cant seem to do a trig regression in R. The equation is as follows : y = a+b*(sin((2*pi*x/360) - c))^2 a, b, c are coefs that I want. y, x are input vectors. The equation I put into R: lm(y ~ sin(2*pi*x/360)^2) This equation is missing the c and I dont get the right answer. Also, I dont know how to plot the lm over the x values instead of the indices. Any help is sincerely appreciated. Thank you all very much. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] Help with time in R
Ms. Chisholm, If you could tell us how you plan to use the variables, we will have a better understanding of what you are looking for and will be able to help you. Are you looking for the time in seconds? In that case, do as Mr. Holfman says. He just skipped the part about converting the factors to characters. You can do that by: y - as.character(x) where x is the vector of factors. Are you looking to have a list of hours, minutes and seconds? That can be done too...Although it would be much easier to just have hours and min.sec On Tue, Jul 20, 2010 at 7:33 AM, Sarah Chisholm sarah.chisholm...@ucl.ac.uk wrote: Hi, I have a problem with the time formatting in R. I have entered time in the format MM:SS.xyz and R has automatically classified this as a factor, but I need it numerically. However when I use as.numeric() it gives me totally different numbers. Is there any way I can tell R to read thes input as a number? Thank you very much [[alternative HTML version deleted]] __ 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. -- Aaditya Nanduri aaditya.nand...@gmail.com [[alternative HTML version deleted]] __ 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] Historical Libor Rates
Mr. Feldman, I would love nothing more than to reply to your wonderful email with just as much sarcasm. However, the fault lies with my question; I should have been more explicit. It should have been phrased : Where can I find historical OVERNIGHT LIBOR rates? And surprisingly, we both use the great tool, Google. What a wonderful coincidence. Via Google, I found this : http://www.econstats.com/r/rlib__d13.htm However, this site has a lot of missing points and I was really hoping for a complete set of data. But, in all honesty, try to be a little less rude next time. I've been looking for a good source for a while now and the mailing lists are usually my last resort. On Tue, Jul 20, 2010 at 6:58 AM, Marshall Feldman ma...@uri.edu wrote: Hi AAditya, There's a great tool for searching the web, called Google. I used it to find the following web site when I entered historical libor rates for the search: http://www.wsjprimerate.us/libor/libor_rates_history.htm. The site came up as the first hit. I suggest you use the scrapeR package to read data from the site. Also, to learn more about the terrific Google search tool, look at http://www.google.com/. Good luck. Marsh Feldman On 7/20/2010 6:00 AM, r-help-requ...@r-project.org wrote: Date: Mon, 19 Jul 2010 15:21:01 -0400 From: Aaditya Nanduriaaditya.nand...@gmail.com To:r-help@r-project.org to%3ar-h...@r-project.org Subject: [R] Historical Libor Rates Message-ID: aanlktik-dl2kc7e7mkr4hzsxphxyn5mz0jb2esbgg...@mail.gmail.com Content-Type: text/plain Hello All, Does anyone know how to download historical LIBOR rates of different currencies into R? Or if anyone knows of a website that holds all this data...I only need up to january of 2000. Also, how can we make the row names the index of a plot (the names of the x values)? [[alternative HTML version deleted]] -- Dr. Marshall Feldman, PhD Director of Research and Academic Affairs Center for Urban Studies and Research The University of Rhode Island [[alternative HTML version deleted]] __ 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. -- Aaditya Nanduri aaditya.nand...@gmail.com (908) 380-4560 [[alternative HTML version deleted]] __ 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] Historical Libor Rates
Hello All, Does anyone know how to download historical LIBOR rates of different currencies into R? Or if anyone knows of a website that holds all this data...I only need up to january of 2000. Also, how can we make the row names the index of a plot (the names of the x values)? [[alternative HTML version deleted]] __ 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] Time Variable and Historical Interest Rates
Guys, I wrote to the finance mailing list earlier with my questions but was directed here. Sorry for the repeat. --- library(quantmod) now - Sys.time() midnight - strptime()# I want to make this a static variable that will be equal to 12:00:00 am but I dont know what to put here. I keep getting NA for everything I do if(now == midnight) { getFX(EUR/USD, from = Sys.Date() -1, to = Sys.Date() - 1) write.table(EURUSD, ~Documents/stat arb/project/eurusd.csv, append = TRUE, row.names = FALSE, col.names = FALSE) } --- Also, append is ignored when I use write.csv. I had to resort to using write.table. Is this always the case? As for the historical interest rates, thank you all very much for providing me with the information (Finance mailing list). I used the fImport package and called the method fredSeries to download DPRIME data for the same time frame as currency data I have (Thank you, Mr. Gallon). But that is only data for US. What about other countries? I was talking to a professor and he said that there was a way to read data from a website into R if you know the url. Would this help in getting the interest rates of other countries? (I believe the function is aptly named url). Could someone provide an example, please? All help is very much appreciated. Sincerely, Aaditya Nanduri [[alternative HTML version deleted]] __ 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.