[R] coeftest() R squared

2017-02-14 Thread T.Riedle
Dear all, I want to run a regression using lm() with Newey West corrected standard errors. This is the code Reg<-lm(g~sent + liquidity + Cape, data=dataUsa) CoefNW<-coeftest(Reg, vcov.=NeweyWest) CoefNW In contrast to summary(Reg) the output of CoefNW neither returns the adjusted R squared nor

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Hervé Pagès
On 02/14/2017 06:39 PM, Bert Gunter wrote: Yes, exactly. So my point is that this: "X: a vector-like object that supports subsetting with `[`, typically an atomic vector." is incorrect, or at least a bit opaque, without further emphasizing that FUN must accept the result of "[". Maybe

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Bert Gunter
Yes, exactly. So my point is that this: "X: a vector-like object that supports subsetting with `[`, typically an atomic vector." is incorrect, or at least a bit opaque, without further emphasizing that FUN must accept the result of "[". With atomic vectors, the error that you produced was

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Hervé Pagès
Right. More precisely the function passed thru the FUN argument must work on the subsets of X generated internally by tapply(). You can actually see these subsets by passing the identity function: X <- letters[1:10] INDEX <- c(rep(1,5),rep(2,5)) tapply(X, INDEX, FUN=identity) # $`1` # [

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Richard M. Heiberger
The problem with Bert's second example is that sum doesn't work on a list. The tapply worked correctly. > unlist(l[1:5]) [1] 1 2 3 4 5 > sum(l[1:5]) Error in sum(l[1:5]) : invalid 'type' (list) of argument On Tue, Feb 14, 2017 at 8:28 PM, Bert Gunter wrote: > Hervé: > > Kindly explain this, t

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Bert Gunter
Hervé: Kindly explain this, then: > l <- as.list(1:10) > is.atomic(l) # FALSE [1] FALSE > index <- c(rep(1,5),rep(2,5)) > > > tapply(l,index,unlist) $`1` [1] 1 2 3 4 5 $`2` [1] 6 7 8 9 10 > > ## But > > tapply(l,index, sum) Error in FUN(X[[i]], ...) : invalid 'type' (list) of argument Chee

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Hervé Pagès
Hi, tapply() will work on any object 'X' that has a length and supports single-bracket subsetting. These objects are sometimes called "vector-like" objects. Atomic vectors, lists, S4 objects with a "length" and "[" method, etc... are examples of "vector-like" objects. So instead of saying X:

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Bert Gunter
Did you ever receive a reply to this? Note that for your example: > tapply(l,index,sum) Error in FUN(X[[i]], ...) : invalid 'type' (list) of argument A list is definitely not atomic (is.recursive(l) ). So it looks like a "quirk" that FUN = unlist doesn't raise an error. Cheers, Bert Bert Gunt

Re: [R] Create gif from series of png files

2017-02-14 Thread Bert Gunter
Ulrik: Sheepishly Nitpicking (only because you are a regular and wise R-help contibutor): gganimate is not a library, it's a package. No need to reply. Best, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Be

Re: [R] Von Mises mixtures: mu and kappa?

2017-02-14 Thread Bert Gunter
Please search before posting! Searching "von mises mixture distributions" on rseek.org brought up what appeared to be several relevant hits. If none of these meet your needs, you should probably explain why not in a follow up post. Cheers, Bert Bert Gunter "The trouble with having an open mind

[R] Von Mises mixtures: mu and kappa?

2017-02-14 Thread Peter Mills
Hello I am trying to calculate the values of the concentration parameters (kappa) and preferred direction (mu) for a Von Mises mixture model. I currently have some R code that gives me optimised values for the product of kappa and mu, but I'm not sure how to calculate them when both are unknown

Re: [R] Circular plot

2017-02-14 Thread David L Carlson
This is pretty close to your original plot. To get clockwise we multiply the radians by -1 and then add pi/2 to move the origin to 12 o'clock. We need to flip the start and end values since now we are be plotting from the end to the start: start<-c(1,5,600,820) end<-c(250,75,810,1200) score<-c(

Re: [R] minpack package in R version 3.3.2

2017-02-14 Thread J C Nash
You probably wanted minpack.lm, not minpack. FYI, Duncan Murdoch and I just put up nlsr on CRAN. It does ANALYTIC derivatives on expression-form nonlinear models, and also handles function-form problems. It does a Marquardt-stabilized solution, and allows fixed parameters by specifying upper an

Re: [R] minpack package in R version 3.3.2

2017-02-14 Thread Jeff Newmiller
The primary place for finding out about packages is the Comprehensive R Archive Network, or CRAN. Try entering R package minpack CRAN into Google and you should be able to see what you need to do on your own. If you still need help, tell us what you found and why it didn't help when you post

Re: [R] Forecasting using VECM

2017-02-14 Thread Bert Gunter
Searching on "VECM" on rseek.org brought up: "VECM" on the Rdocumentation site, which clearly states: "The predict method contains a newdata argument allowing to compute rolling forecasts." If that is not what you want, you'll need to explain why not, I think. If it is, please do such searching

Re: [R] renameSeqlevels

2017-02-14 Thread Martin Morgan
Rsamtools and GenomicAlignments are Bioconductor packages so ask on the Bioconductor support site https://support.bioconductor.org You cannot rename the seqlevels in the bam file; you could rename the seqlevels in the object(s) you have created from the bam file. Martin On 02/14/2017 09:1

Re: [R] CAR

2017-02-14 Thread Bert Gunter
Rseek.org brings up what look like relevant hits on "conditional autoregressive models." Have you looked at these? If so and they do not suit, perhaps you should explain why not. If they do, please do such searching on your own in future. Cheers, Bert Bert Gunter "The trouble with having an ope

[R] CAR

2017-02-14 Thread Siswanto Sumargo
*I would like to simulate spatial data conditional **autoregressive (CAR) model with weighted matrix order 2**Is there any package or function in R to perform it ? **Thanks in advance* *Best Regards Siswanto* -- *Siswanto* Department of Statistics, Faculty of Mathematics and Natural Science Bogo

[R] Forecasting using VECM

2017-02-14 Thread Preetam Pal
Hi, I have attached the historical dataset (titled data) containing numerical variables GDP, HPA, FX and Y - I am interested to predict Y given some future values of GDP, HPA and FX. - Some variables are non-statioanry as per adf.test() - I wanted to implement a VECM framework for modeling

[R] renameSeqlevels

2017-02-14 Thread Teresa Tavella
Dear all, I would like to ask if it is possible to change the seqnames of a bam file giving a vector of character to the function renameSeqlevels. This is because in order to use the fuction summarizeOverlap or count/find, the seqnames have to match. >From the bamfile below I have extracted the lo

[R] minpack package in R version 3.3.2

2017-02-14 Thread Malgorzata Wieteska via R-help
Hello, I'm new to R. I found very useful for me code for parameter estimation. Unfortunately, while trying to install "minpack" I get info, that this package is not available for version 3.3.2. I'm using Windows 10. Does anyone know how to overcome this and maybe a hint on which version of R it

Re: [R] Create gif from series of png files

2017-02-14 Thread Duncan Murdoch
On 14/02/2017 5:53 AM, Shane Carey wrote: Hi, I have many png files that I would like to stitch together, in order to make a gif file. Any ideas how I would do this? ImageMagick is good for this. The magick package in R makes most (all?) of its features available. The image_animate() funct

[R] VAR for Non Stationary series using R

2017-02-14 Thread Lal Prasad
Hi All, Is there any suggested approaches for using non-stationary series in VAR model? As per otexts.org , there is something like "VAR in differences which could be used for such series. Are there any other

Re: [R] [FORGED] Re: get() return nothing

2017-02-14 Thread Ben Tupper
Hi, When you want to get 'something' out of a loop you need to assign that 'something' to a variable that persists outside of the loop. I think it is a scoping thing. In your situation you could create a list with as many elements as there are objects with 'txt' in their names. I can't quite f

Re: [R] Create gif from series of png files

2017-02-14 Thread Shane Carey
Hi Ulrick, I created the png's in R and was hoping there would be a way of stitching them together in R. Is there a different forum I should be posting to? Thanks On Tue, Feb 14, 2017 at 11:33 AM, Ulrik Stervbo wrote: > Hi Shane, > > Wrong forum. This might be what you are looking for > > ffm

Re: [R] Create gif from series of png files

2017-02-14 Thread Ulrik Stervbo
Hi Shane, Wrong forum. This might be what you are looking for ffmpeg -i %03d.png output.gif Or use the library gganimate. Best Ulrik Shane Carey schrieb am Di., 14. Feb. 2017, 12:08: > Hi, > > I have many png files that I would like to stitch together, in order to > make a gif file. > > Any

[R] Create gif from series of png files

2017-02-14 Thread Shane Carey
Hi, I have many png files that I would like to stitch together, in order to make a gif file. Any ideas how I would do this? Thanks -- Le gach dea ghui, Shane [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UN

Re: [R] [FORGED] Re: get() return nothing

2017-02-14 Thread Rolf Turner
On 14/02/17 05:50, Fix Ace via R-help wrote: Well, I am not trying to print anything. I just would like to get the dimension information for all the dataframes I created. Could you please help me to develop the script? Thanks. Ace Yes you *are* trying to print something. You are trying to