[R] Reading multiple csv files

2010-02-26 Thread Madhavi Bhave
Dear R helpers   Some particular analysis leads me to various number of output csv files depending on some conditions. Say e.g. I have output files variable1.csv, variable2.csv, .. Problem is I don't know how many csv files been generated. They could be 4, 5 or even 10. Each file

[R] How to use same function for diffrent input values

2010-02-19 Thread Madhavi Bhave
Dear R helpers   I have written some function (the actual code I have pasted at the end of mail) like say   indiv_rate = function(n, rate_name, rate, rate_rf1, rate_rf2, rate_rf3, rateprob1, rateprob2, rateprob3) { some R commands   return(data.frame(rate_name, rates = round(rate_data,

[R] Storing processed results in a loop

2010-02-15 Thread Madhavi Bhave
Dear R Helpers   I have an 'instrument.csv' file with 3 instrument names and 5 rates each i.e. it has 7 columns and 6 rows (including row names).   'instrument.csv'   instrument1  instrument2   instrument3 12 5    14 11   

[R] CORRECTION - Storing results in a loop

2010-02-15 Thread Madhavi Bhave
Dear R Helpers (There is a small correction in my earlier mail. In the 'instrument.csv' file, I had mentioned only three columns. Actually there are 7 columns. I regret the error. Rest contents remains the same. Thanks) I have an 'instrument.csv' file with 7 instrument names and 5 rates each

Re: [R] CORRECTION - Storing results in a loop

2010-02-15 Thread Madhavi Bhave
beniltoncarva...@gmail.com Subject: Re: [R] CORRECTION - Storing results in a loop To: Madhavi Bhave madhavi_bh...@yahoo.com Cc: r-help@r-project.org Date: Monday, 15 February, 2010, 4:29 AM sorry, meant to type: B = ONS^2 cheers, benilton On Mon, Feb 15, 2010 at 12:28 PM, Benilton Carvalho

Re: [R] Total and heading of portfoilo table

2010-02-15 Thread Madhavi Bhave
Hi!   I am not expert in R, but perhaps you can try the following -   X = as.numeric(read.csv('quantity.csv')) Y = read.csv('equity_price.csv') Y = Y[, -1]   Z = X*Y   port_val = NULL   for(i in 1 : nrow(Z)) {   port_val[i] = sum(Z[i,])   }   write.csv(data.frame(Z, port_val = port_val),

[R] How to repeat the names?

2010-02-10 Thread Madhavi Bhave
Dear R helpers   I have a city.csv file as given below.   'city.csv' city_name1    city_name2 New York City    Buffallo     So I define   city_name = read.csv('city.csv') city1 = city_name$city_name1 city2 = city_name$city_name2   My problem is how do I repeat the names one after other

Re: [R] How to repeat the names?

2010-02-10 Thread Madhavi Bhave
February, 2010, 1:54 AM Hi! I'm kind of a newboe here, but I think it is because read.csv transforms the character variables to factors. Maybe try setting the argument as.is in read.csv(). Or try: rep(as.character(c(city1, city2)),5) That should work. HTH Ivan Le 2/10/2010 10:44, Madhavi

[R] Yield to Maturity using R

2010-02-02 Thread Madhavi Bhave
, interval = c(0, 25)) : f.lower = f(lower) is NA Please guide. ytm should be 0.09601 (i.e. 9.601%)     with regards   Madhavi Bhave     Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! http://downloads.yahoo.com/in/internetexplorer/ [[alternative HTML version

Re: [R] Yield to Maturity using R

2010-02-02 Thread Madhavi Bhave
Subject: Re: [R] Yield to Maturity using R To: Madhavi Bhave madhavi_bh...@yahoo.com Date: Tuesday, 2 February, 2010, 3:49 AM Hi: On Tue, Feb 2, 2010 at 3:01 AM, Madhavi Bhave madhavi_bh...@yahoo.com wrote: Dear R helpers,     Yesterday I had raised following query which was addressed by Mr

[R] 'R' and 'Yield to Maturity'

2010-02-01 Thread Madhavi Bhave
Dear R helpers   I am calculating the 'Yield to Maturity' for the Bond with following characteristics.   Its a $1000 face value, 3 year bond with 10% annual coupon and is priced at 101. The yield to maturity can be calculated after solving the equation -   1010 = [100 / (1+ytm)]  + [100 /

Re: [R] 'R' and 'Yield to Maturity'

2010-02-01 Thread Madhavi Bhave
s.elli...@lgc.co.uk Subject: Re: [R] 'R' and 'Yield to Maturity' To: Craig P. Pyrame crap...@gmail.com, Madhavi Bhave madhavi_bh...@yahoo.com Cc: r-help@r-project.org Date: Monday, 1 February, 2010, 3:41 AM If you know the likely range, uniroot would do it. f.ytm-function(ytm) 100 / (1+ytm)  +100

[R] How to sort data.frame

2010-01-27 Thread Madhavi Bhave
Dear R heleprs   Suppose I have following data   Scenarios combination_names     series1    series2 Sc1 MAT2 GAU1 7.26554 8.409778 Sc2 MAT2 GAU2 7.438128 8.130275 Sc3 MAT3 GAU1 8.058422 8.06457 Sc4 MAT1 GAU2 8.179855 8.022071 Sc5 MAT3 GAU2 8.184033 8.191831 Sc6 MAT3 GAU2 7.50312

[R] Macaulay Duration for Group

2010-01-19 Thread Madhavi Bhave
guide me as to how do I modify the R-code to calculate Mac duration for each of tehse records and store tehm.   Regards   Madhavi Bhave   The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. [[alternative HTML version deleted

[R] Macualay Duration code in a Functional Form - Please Help

2010-01-19 Thread Madhavi Bhave
  826.9026  826.9019 which is I know wrong. Is there any other way I can use the function defined above to process multiple recrds. Thanking you and sincerely apologize for writing such a long mail as I wanted to be clear in my communication. Regards Madhavi Bhave ONS  = read.csv

[R] Please Please Please Help me!!

2010-01-19 Thread Madhavi Bhave
Dear R helpers   (I have already written the required R code which is giving me correct results for a given single set of data. I just wish to wish to use it for multiple data.)   I have defined a function (as given below) which helps me calculate Macaulay Duration and Modified Duration and its

[R] Parameters of Logistic Distribution and (3 Parameter) Log Logistic Distribution

2009-07-31 Thread Madhavi Bhave
Dear R Helpers Please guide me how one can estimate the parameters of Logistic Distribution and 3 Parameter Log-logistic distribution for a given data. data -

[R] Problem with Poisson - Chi Square Goodness of Fit Test - New Mail

2008-08-29 Thread Madhavi Bhave
Dear R-help,     Chi Square Test for Goodness of Fit   I have got a discrete data as given below (R script)  

[R] Interpreting Logistic Regression

2008-08-21 Thread Madhavi Bhave
Hi ! This is Madhavi from Mumbai, India. Incidently this is my first post. I am working on Credit Scoring Model and using R, I have run the logistic regression. I have received following Output. I have two questions (a) What is the significance of family = binomial(link = logit). Why do I