search for: vincy

Displaying 20 results from an estimated 111 matches for "vincy".

Did you mean: vince
2011 Mar 29
3
Reversing order of vector
...("ABC", "XYZ", "LMN", "DEF")) > vect1 [1] "ABC" "XYZ" "LMN" "DEF" I want to reverse the order of this vector as vect2 = c("DEF", "LMN", "XYZ", "ABC") Kindly guide Regards Vincy [[alternative HTML version deleted]]
2011 Aug 23
4
Correlation discrepancy
...he covariance using the formula as covariance = sum((x-mean(x))*(y-mean(y)))/8       # no of of paired obs. = 8 or     covariance = sum(x*y)/8-(mean(x)*mean(y)) gives covariance = 2.125 I am not able to figure out where I am going wrong w.r.t. the covariance formula. Kindly guide. Regards Vincy [[alternative HTML version deleted]]
2010 Oct 27
4
One silly question about "tapply output"
...able to save this output as csv file with respective headings and should be able to carry out further analysis) Rating         Mean AAA            9.1104 BBB           11.1361637 CCC           17.1606779 Please guide as how should I achieve my output like this.    Thanking in advance. Regards Vincy [[alternative HTML version deleted]]
2011 Mar 09
3
Rearranging the data
...          y         40 USA            z         70 UK             x         50 UK             y         80 UK             z         62   Canada         x         20   Canada         y         35 Canada         z         10 I did try reshape package but things are in mess. Please guide Regards Vincy     [[alternative HTML version deleted]]
2011 Jan 25
4
Subtracting elements of data.frame
...ed an output like > df_new    x   y 1  0   0 2 13 398 3  2 -62 4 20  -1 5 10  87 As I had mentioned above, I have number of columns in reality and thus I can't use the command say df_new = data.frame(x = df$x-df$x[1], y = df$y-df$y[1]) Kindly guide Thanking you all in advance Regards Vincy [[alternative HTML version deleted]]
2011 Mar 16
2
One to One Matching multiple vectors
...  2,  3) y = c("A", "B", "C", "D") z = c(1, 3) For given values of z, I need to the values of y. So I should get "B" and "D". I tried doing y[x][z] but it gives > y[x][z] [1] "A" "C" Kindly guide. Regards Vincy [[alternative HTML version deleted]]
2011 May 30
2
Value of 'pi'
Dear R helpers, I have one basic doubt about the value of pi. In school, we have learned that pi = 22/7 (which is = 3.142857). However, if I type pi in R, I get pi = 3.141593. So which value of pi should be considered? Regards Vincy [[alternative HTML version deleted]]
2011 Aug 25
1
Autocorrelation using acf
...8,4.63)     # Original series with last element deleted cor(e_t1, e_t2) > cor(e_t1, e_t2) [1] -0.8732316 However, if I use acf(y, 1) Autocorrelations of series ‘y’, by lag     0     1 1.000 0.343 I am simply not able to figure out how acf is used? Thanking you in advance. Regards Vincy --- On Wed, 8/24/11, Prof Brian Ripley <ripley@stats.ox.ac.uk> wrote: From: Prof Brian Ripley <ripley@stats.ox.ac.uk> Subject: Re: [R] Autocorrelation using library(tseries) To: "Vincy Pyne" <vincy_pyne@yahoo.ca> Cc: r-help@r-project.org Received: Wednesday, August 24...
2011 Sep 14
2
Question regarding dnorm()
...excel also gives 0.03989422. Obviously my understanding is wrong. If I put value of x = 0 in the normal density function, I do get 0.03989422. My confusion is on the continuous scale if the probability (X = x) doesn't make sense, 0.03989423 is significant to neglect. Please clarify Regards Vincy [[alternative HTML version deleted]]
2010 Dec 09
4
Sequence generation in a table
..., j] : incorrect number of dimensions. Also, I understand above logic will generate a result in (3 by 6) matrix format, while I need to generate only 3 numbers pertaining to first no. i.e. 257, 6 nos. beginning from 520, and only 2 numbers beginning from 110. I also tried tapply etc. Please guide Vincy [[alternative HTML version deleted]]
2012 May 22
3
What's wrong with MEAN?
...14 So instead of calculating simple Arithmetic average, mean command is generating first element as average. I restarted the machine, changed the machine, but still the reply is same. I have been using this mean function ever since I strated learning R, but this has never happened. Kindly guide Vincy [[alternative HTML version deleted]]
2011 Mar 15
2
Matching two vectors
...uot;CCC") vect_1_id = c(1:length(vect_1)) Through some process I obtain vect_2_id = c(2, 3, 7), then I need a new vector say vect_2 which will give me vect2 = ("AA", "A", "CCC")  i.e. I need the subset of vect_1 as per vect_2_id. Thanking in advance Regards Vincy [[alternative HTML version deleted]]
2012 Apr 20
3
Matrix multiplication by multple constants
...  10    27 [2,]    2    12    30 [3,]    3    14    33 [4,]    4    16    36 When I tried simple multiplication like x*y, y is getting multiplied column-wise > x*z       [,1] [,2] [,3] [1,]    1    5    9 [2,]    4   12   20 [3,]    9   21   33 [4,]   16   32   48 Kindly guide Regards Vincy [[alternative HTML version deleted]]
2010 Dec 31
3
Changing column names
...so there could be addition or deletion of some country names. Also, if there are say 150 country names, the above way (i.e. writing.csv) of defining the column names is not practical. Basically I want to change the column heads after the 'result.csv' is generated. Kindly guide. Regards Vincy [[alternative HTML version deleted]]
2012 Sep 12
6
How to append the random no.s for different variables in the same data.frame
...th value generated for product1) product2         ....... product2         ....... ............................ ............................ ............................ Problem - B Also, is it possible to have more than one 'return' statements in a given function? Thanking in advance Vincy [[alternative HTML version deleted]]
2011 Mar 21
2
Correlation for no of variables
...can find out the correlation as cor(returns) and expect to get 1500 * 1500 matrix. However, the process takes a tremendous time. Is there any way in expediting such a process. In reality, I may be dealing with lots of even 5000 stocks and may simulate even 100000 stock returns. Kindly guide. Vincy [[alternative HTML version deleted]]
2012 Jul 19
3
Maintaining Column names while writing csv file.
...are as date, r1, r2, r3, X1w, X2w My original output file has about 200 columns so it is not possible to write column names individually. Also, I can't change the column names since I am receiving these files from external source and need to maintain the column names. Kindly guide Regards Vincy [[alternative HTML version deleted]]
2011 Feb 28
1
Replacing an element in a vector
...  # 3rd element is 0 C = A/B > C [1] 0.01 0.10  NaN 0.20 0.20 Obviously, I can't divide 0/0 and hence NaN. My problem is how to replace this NaN say by 0. So that I can have C as C = c(0.01, 0.10, 0, 0.20, 0.20) I tried the replace command but can't get rid of NaN. Kindly guide. Vincy [[alternative HTML version deleted]]
2012 Jul 18
2
How to have original (name) order after melt and cast command
....15429 5 2012-03-26   0.073430586   5.014954   10.20399 4 2012-03-23   0.037299722   5.820460   10.22967 3 2012-03-22   0.099807733   5.403882   10.20968 2 2012-03-21   0.042072817   5.009507   10.22928 1 2012-03-20   0.099487289   4.807764   10.02439 Kindly guide Thanking in advance Vincy [[alternative HTML version deleted]]
2012 Jul 04
3
How to use Sys.time() while writing a csv file name
...""), row.names = FALSE) I am able to store these simulated recovery rates in different files. But I need to use Sys.time in my csv file name. (or is there any other way of writing these csv files so that files don't get over-written). Kindly guide. Regards and thanking in advance Vincy [[alternative HTML version deleted]]