Displaying 20 results from an estimated 2000 matches similar to: "Reading multiple csv files"
2010 Feb 01
4
'R' and 'Yield to Maturity'
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 / (1+ytm)^2] + [ 1100 / (1 + ytm)^3]
This can be solved by trial and error method s.t. ytm = 9.601%.
2010 Feb 02
2
Yield to Maturity using R
Dear R helpers,
Yesterday I had raised following query which was addressed by Mr Ellison. The query and the wonderful solution as provided by Mr. Ellison are as given below.
## PROBLEM
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
2010 Jan 20
2
Please Please Please Help me!!
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 working fine with given set of data.
My Code -
## ONS - PPA
duration = function(par_value,
2010 Feb 10
3
How to repeat the names?
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 say 10 times i.e. my output should be like
New York
City Buffallo
New York
City
2010 Feb 15
1
CORRECTION - Storing results in a loop
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 i.e. it has 7 columns and 6 rows (including row names).
'instrument.csv'
2010 Feb 15
1
Storing processed results in a loop
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 7 7
14 11 3
2010 Feb 19
1
How to use same function for diffrent input values
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, digits = 4)))
}
## INPUT
rates = indiv_rate(n = read.csv('number.csv')$n, rate_name =
2008 Aug 21
1
Interpreting Logistic Regression
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 have to mention Binomial? Is it because my dependent variable assumes only two values 0 and 1?
2010 Jan 27
1
How to sort data.frame
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
8.232425
Sc7
MAT1 GAU2
7.603291
8.200993
Sc8
MAT1 GAU1
8.221755
8.380097
Sc9
MAT3 GAU2
7.904908
2010 Feb 26
3
Preserving lists in a function
Dear R users,
A co-worker and I are writing a function to facilitate graph plotting in R. The function makes use of a lot of lists in its defaults.
However, we discovered that R does not necessarily preserve the defaults if we were to input them in the form of list() when initializing the function. For example, if you feed the function codes below into R:
myfunction=function(
list1=list
2012 Feb 20
0
repeating or looping within an apply statement to handle multiple variables
Dear R experts,
I would like to please ask for your help with repeating steps in an apply
statement.
I have a dataframe that lists multiple variables for a given id and visit,
as well as drug treatment.
> head(exp)
id visit variable1 variable2 variable3 variable4 drug
1 3 1 13 10 7 11 0
2 3 5 10 15 9 9 0
3 3 12
2003 Sep 02
1
source code for samba-2.2.8a-1-sol8-suncc-64bit.pkg
Hi all,
Where could I get souce code for samba-2.2.8a-1-sol8-suncc-64bit.pkg, I
checked in samba.org but I just found pacakage(
samba-2.2.8a-1-sol8-suncc-64bit.pkg).
Thanks,
Madhavi
2009 Jul 30
3
What is the best method to produce means by categorical factors?
I am attempting to replicate some of my experience from SAS in R and assume
there are best methods for using a combination of summary(), subset, and
which() to produce a subset of mean values by categorical or ordinal
factors.
within sas I would write
proc means mean data=dataset;
class factor1 factor2
var variable1 variable2;
RUN;
producing an output with means for each variable by factor
2012 Jan 02
4
Create variable with AND IF statement
Hello,
I'm using SPSS at work but really would like to switch to R. Right now I'm
trying to learn R in reproducing calculations I did with SPSS but am stuck
with something that is quite simple and comprehensible in SPSS-Syntax:
IF (variable1.fac = 0 AND variable2.num = 0) variable3=1.
IF (variable1.fac = 0 AND variable2.num >= 1) variable3=2.
IF (variable1.fac = 1 AND variable2.num =
2006 Jul 03
1
analogue of group option of SAS MIXED/random in R
Dear list,
I am trying to use lme to build the analogue of the following SAS MIXED
random specification:
random int+Variable1+Variable2 /subject = Subject group=Condition type=vc;
which gives a Condition-blocked heterogeneity in the random effects
variance-covariance matrix.
Needless to say, I have a hard time in specifying Condition-specific
heterogeneities in the variance-covariance
2011 Apr 18
4
altering identity column
Hi there,
I have a huge dataframe containing 70,000 observations.
I have filtered this dataframe (let it's name be "transformed_dataframe") as I wanted to select only those observations which are greater than or equal to 60,001 regarding the very first identity column.
So I have a transformed dataframe now including 10,000 obeservations (from 60,001 - to 70,000) and if you send
2009 Dec 04
2
Multiple Channel Variables with AMI Originate
Hi guys I seem to be having a problem, I don't know if it's a bug or whether
I'm just doing it incorrectly.
I want to set about 3 channel variables when I originate a call via AMI.
All the documentation I have found says to do it like this:
Variable: variable1=value|variable2=value|variable3=value
However when I do this it runs them all together and I end up with:
2009 Jan 29
1
Multiple tables
Dear list,
I have a set of 100+ variables. I would like to have one by one crosstables for each variable. I started with
table(variable1, variable2)
table(variable1, variable3)
table(variable1, variable4)
...
table(variable2, variable3)
table(variable2, variable4)
...
It seems rather tedious.
Any better ideas around?
Thanks for any help!
Gerit
--
NUR NOCH BIS 31.01.! GMX FreeDSL -
2007 Jun 13
3
Awk and Vilno
In clinical trial data preparation and many other data situations, the
statistical programmer needs to merge and re-merge multiple input
files countless times. A syntax for merging files that is clear and
concise is very important for the statistical programmer's
productivity.
Here is how Vilno does it:
inlist dataset1 dataset2 dataset3 ;
joinby variable1 variable2 where ( var3<=var4 ) ;
2006 Sep 24
2
printing a variable name in a for loop
Hello,
How do you print a variable name in a for loop?
I'm trying to construct a csv file that looks like this:
Hello, variable1, value_of_variable1, World,
Hello, variable2, value_of_variable2, World,
Hello, variable3, value_of_variable3, World,
Using this:
for (variable in list(variable1, variable2, variable3)){
cat("Hello,", ???variable???, variable, ",