Re: [R] Code works on Mac but not Windows

2015-05-10 Thread Thierry Onkelinx
Dear Glenn, We need more details on the function. Please provide a commented, minimal, self-contained version of the function that reproduces the problem (as the posting guide asks you to do). Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Natu

Re: [R] Variance-covariance matrix

2015-05-10 Thread Giorgio Garziano
Hi Tsjerk, Yes, I understand your point. Thanks for drawing my attention on that aspect. Let me then rephrase my question. I would need some R package function able to compute the variance-covariance matrix for multivariate series as defined at: http://stattrek.com/matrix-algebra/covar

Re: [R] confidence intervals for differences in proportions from complex survey design?

2015-05-10 Thread Anthony Damico
i don't know the answer to your larger question, but for confidence intervals around proportions you might look at ?svyciprop. one of the method= options might yield the same result as your approximation, not sure On Mon, May 11, 2015 at 12:40 AM, Brown, Tony Nicholas < tony.n.br...@vanderbilt.ed

Re: [R] [R-sig-Fedora] Building R-3.2.0 from source.

2015-05-10 Thread Tom Callaway
I just landed in Paris, and haven't read backwards in this thread, but I've done 3.2.0 builds for all current Fedora releases, they're all in updates-testing (I think the Fedora 22 builds are in updates stable now). The thing that changed is that R doesn't bundle a number of libraries like it u

[R] lmom and lmomRFA Upper and Lower Bounds Simulation Questions

2015-05-10 Thread Douglas Hultstrand
Hello, I am using the lmom and lmomRFA to compute the return frequencies using the GEV distribution.Iam trying to generate upper and lower bound frequency estimates. I provided a working example of the code that I am using to estimate the upper and lower bounds. Specific questions I have are:

[R] confidence intervals for differences in proportions from complex survey design?

2015-05-10 Thread Brown, Tony Nicholas
All: I need to generate confidence intervals for differences in proportions using data from a complex survey design. An example follows where I attempt to estimate the difference in depression prevalence by sex. # Data might look something like this: Dfr<-data.frame(depression=sample(c("yes","n

[R] Code works on Mac but not Windows

2015-05-10 Thread Glenn Schultz
Hello All, Testing my code on a Windows based machine today.  There seems to be an offending line of code.  I have pasted it below.  Basically, I check to see if the user passed a fit method to TermStructure and if not then default to "ns".   The above works fine on my Mac but a windows build

Re: [R] [R-sig-Fedora] Building R-3.2.0 from source.

2015-05-10 Thread Rolf Turner
On 11/05/15 12:06, M. Edward (Ed) Borasky wrote: 1. R 3.2.0 is packaged for Fedora now; it's in Rawhide and Fedora 22. I'm running Fedora 22 (late beta) and haven't had any problems with R. RStudio Desktop Preview (0.99.435) from the RStudio Fedora RPM is also running fine. You might save yoursel

[R] fonts in R-3.2.0

2015-05-10 Thread Jim Lemon
Hi all, I compiled R-3.2.0 from source a few weeks ago and was surprised to find that the only font that appeared on plots was the System font, not the most elegant. I had R-3.1.3 previously and all fonts seemed to be available on my system (Fedora 21). I have the latest version of urw-fonts (2.4-1

Re: [R] how to update a value in a list with lapply

2015-05-10 Thread William Dunlap
You can do the timing yourself on a dataset which you feel is typical of your usage. E.g., define a function the implements each algorithm > f1 <- function(foo) lapply(foo, function(x) { if (x[1] == 1) x[2] <- 0 ; x }) > f2 <- function(foo) { for(i in seq_along(foo)) if (foo[[i]][1] == 1) foo[[

Re: [R] Building R-3.2.0 from source.

2015-05-10 Thread Rolf Turner
I am cross-posting this to r-sig-fedora (I hope that's not an egregious sin) in the hope that doing so might provide some source of insight. I tried sudo yum install zlib and was told Package zlib-1.2.5-7.fc17.x86_64 already installed and latest version Likewise for "zlib-devel". I

Re: [R] Variance-covariance matrix

2015-05-10 Thread Tsjerk Wassenaar
Hi Giorgio, This is for a multivariate time series. x1 is variable 1 of the observation vector x, x2, variable 2, etc. If you need x(i) and x(i+1), etc, then you're looking for the autocovariance/autocorrelation matrix, which is a quite different thing (and David showed the way). You can easily se

Re: [R] Variance-covariance matrix

2015-05-10 Thread Giorgio Garziano
Hi Tsjerk, Yes, seriously. Time series: X = [x1, x2, x3, ,xn] The variance-covariance matrix is V matrix: V= Σ x12 / (N-1) Σ x1 x2 / (N-1) . . . Σ x1 xn / (N-1) Σ x2 x1 / (N-1) Σ x22 / (N-1) . . . Σ x2 xn / (N-1) . . . . . . . . . . . . Σ xn x1 / (N-1) Σ xn x

Re: [R] Variance-covariance matrix

2015-05-10 Thread Tsjerk Wassenaar
Hi Giorgio, For a univariate time series? Seriously? data <- rnorm(10,2,1) as.matrix(var(data)) Cheers, Tsjerk On Sun, May 10, 2015 at 9:54 PM, Giorgio Garziano < giorgio.garzi...@ericsson.com> wrote: > Hi, > > Actually as variance-covariance matrix I mean: > > http://stattrek.com/ma

Re: [R] Variance-covariance matrix

2015-05-10 Thread Giorgio Garziano
Hi, Actually as variance-covariance matrix I mean: http://stattrek.com/matrix-algebra/covariance-matrix.aspx that I compute by: data <- rnorm(10,2,1) n <- length(data) data.center <- scale(data, center=TRUE, scale=FALSE) var.cov.mat <- (1/(n-1)) * data.ce

Re: [R] Variance-covariance matrix

2015-05-10 Thread David Winsemius
On May 10, 2015, at 4:27 AM, Giorgio Garziano wrote: > Hi, > > I am looking for a R package providing with variance-covariance matrix > computation of univariate time series. > > Please, any suggestions ? If you mean the auto-correlation function, then the stats package (loaded by default at

Re: [R] get the first row ?

2015-05-10 Thread David Winsemius
On May 10, 2015, at 2:26 AM, Ragia Ibrahim wrote: > Dear group > kindly > > I have a logical data type > ISINFCluster: >1 2 3 4 5 6 7 8 910111213 > 14 > FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE > FALS

Re: [R] how to update a value in a list with lapply

2015-05-10 Thread David Winsemius
On May 10, 2015, at 6:11 AM, ce wrote: > > yes indeed : > > foo <- lapply(foo, function(x) if(x[1] == 1 ) {x[2] <- 0; x }else{x} ) > > would work. But if the list is too long, would it be time consuming rather > than just updating elements that meet the if condition? Any change to an object

Re: [R] New to R

2015-05-10 Thread John Kane
Welcome to R and the R-help list Not oriented to finance but just general info A good source of introductory sources is available at http://www.introductoryr.co.uk/R_Resources_for_Beginners.html. BTW I've never seen the author's book but it does look interesting. :) I have had a look at most o

Re: [R] how to update a value in a list with lapply

2015-05-10 Thread ce
yes indeed : foo <- lapply(foo, function(x) if(x[1] == 1 ) {x[2] <- 0; x }else{x} ) would work. But if the list is too long, would it be time consuming rather than just updating elements that meet the if condition? thx ce -Original Message- From: "David Winsemius" [dwinsem...@comca

Re: [R] get sub elements

2015-05-10 Thread Boris Steipe
I think the "record number" i.e. the indices of the elements were asked for. That would be: which(5 <= allrecords & allrecords <= 9) Cheers, B. On May 10, 2015, at 7:33 AM, Rui Barradas wrote: > Hello, > > You should learn about indexing in R. Read the pdf R-intro.pdf that comes >

Re: [R] Building R-3.2.0 from source.

2015-05-10 Thread peter dalgaard
> On 10 May 2015, at 14:15 , Rolf Turner wrote: > > > > I am just now getting around to upgrading from 3.1.2 to 3.2.0 and am getting > hammered by a problem which is beyond my limited capabilities of handling. > > I executed > > ./configure --with-tcltk --with cairo > > which seemed to go

[R] Building R-3.2.0 from source.

2015-05-10 Thread Rolf Turner
I am just now getting around to upgrading from 3.1.2 to 3.2.0 and am getting hammered by a problem which is beyond my limited capabilities of handling. I executed ./configure --with-tcltk --with cairo which seemed to go just fine, and then did: make In fairly short order I started g

Re: [R] get sub elements

2015-05-10 Thread Rui Barradas
Hello, You should learn about indexing in R. Read the pdf R-intro.pdf that comes with your installation of R. allrecords[5 <= allrecords & allrecords <= 9] should do it. Hope this helps, Rui Barradas Em 10-05-2015 11:00, Ragia Ibrahim escreveu: Dear group I have this numeric object allrec

[R] Variance-covariance matrix

2015-05-10 Thread Giorgio Garziano
Hi, I am looking for a R package providing with variance-covariance matrix computation of univariate time series. Please, any suggestions ? Regards, Giorgio [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UN

Re: [R] get the first row ?

2015-05-10 Thread J Robertson-Burns
It looks to me like you need to understand subscripting in R. One place (among many) to learn subscripting is: http://www.burns-stat.com/documents/tutorials/impatient-r/ Pat On 10/05/2015 10:26, Ragia Ibrahim wrote: Dear group kindly I have a logical data type ISINFCluster: 1 2

[R] get sub elements

2015-05-10 Thread Ragia Ibrahim
Dear group I have this numeric object allrecords 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 1 2 1 3 1 1 2 5 4 1 6 8 1 2 1 3 3 2 13 1 4 2 4 7 1 14 1 1 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 1 1

Re: [R] get the first row ?

2015-05-10 Thread Jim Lemon
Hi Ragia, This is a bit cryptic. "ISINFCluster" looks like a 50 element logical vector with two TRUE values. "all" looks like a 50 element numeric vector of counts for each value. "firstclass" contains the 20th and 27th elements of "all", selected with "ISINFCluster". As "firstclass" is a two eleme

[R] get the first row ?

2015-05-10 Thread Ragia Ibrahim
Dear group kindly I have a logical data type ISINFCluster: 1 2 3 4 5 6 7 8 910111213 14 FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE 1516171819202122232425

Re: [R] New to R

2015-05-10 Thread rex
Boris Chow [2015-05-09 20:04]: I want to do a pricing of an American option as my first exercise. Can some experienced users give me some pointers to do so? https://stat.ethz.ch/mailman/listinfo/r-sig-finance http://cran.r-project.org/web/packages/AmericanCallOpt/AmericanCallOpt.pdf http:/