Re: [R] isssues with predict.coxph, offset, type = "expected", and newdata

2016-10-02 Thread David James
Thanks Terry, Re: the second case (predicting from a null model with a newdata= argument), I agree that it looks a bit over the top for such a straight forward computation, so maybe it is more a wish than anything else. In this one instance, this computation is embedded in a wider multi-state

Re: [R] Font problem.

2016-10-02 Thread Jeff Newmiller
There is R-sig-debian (Ubuntu is a derivative of Debian), but to be honest, this seems more like a question for askubuntu.com. -- Sent from my phone. Please excuse my brevity. On October 2, 2016 1:55:59 PM PDT, Rolf Turner wrote: > >Dunno exactly whom I should ask

Re: [R] Font problem.

2016-10-02 Thread Jim Lemon
Hi Rolf, I would try using dnf (or whatever the Ubuntu equivalent is) to install the X11 fonts. You may have a GUI method for this in Ubuntu. Jim On Mon, Oct 3, 2016 at 7:55 AM, Rolf Turner wrote: > > Dunno exactly whom I should ask about this problem, but I thought

Re: [R] Histogram using Sturges' Bining Errors

2016-10-02 Thread Jim Lemon
Hi Elysa, This is pretty much a guess. If you understand the first error, i.e. that there are nine rows in your input data frame (?) that contain NA, NaN, or Inf values, have you tried manually removing those rows and feeding the remainder to your code? Jim On Sun, Oct 2, 2016 at 7:19 PM, Elysa

Re: [R] BCa confidence bands around fitted curves MARS regression

2016-10-02 Thread varin sacha via R-help
Hi, So, I can draw/plot the usual 95% least squares confidence bands around the 3 fitted curves for MARS regression, but I don't know how to get the 95% BCa bootstrapped confidence bands. Any help would be highly appreciated. Reproducible example : ## Dataset =

[R] Font problem.

2016-10-02 Thread Rolf Turner
Dunno exactly whom I should ask about this problem, but I thought I'd start with good old r-help. I have recently acquired a new laptop, and have installed Ubuntu 16.04 on it. Still having some teething problems. If I do plot(1:10,ylab=expression(italic(J(r))) I get the error: Error in

Re: [R] Extract an invertible submatrix

2016-10-02 Thread Richard M. Heiberger
Use qr tmp <- cbind(matrix(rnorm(30), 5, 6), 0)[, c(1,2,3,4,7,5,6)] tmp tmp.qr <- qr(tmp) tmp.qr tmp.qr$pivot tmp.subset <- tmp[, tmp.qr$pivot[1:tmp.qr$rank]] solve(tmp.subset) On Sun, Oct 2, 2016 at 2:19 PM, Bertrand Marc wrote: > Dear R helpers, > > I am looking for an

Re: [R] Can I get odd ratios from lm() model or only glm()?

2016-10-02 Thread David Winsemius
> On Oct 2, 2016, at 9:24 AM, mviljamaa wrote: > > I'm doing logistic regression and I need to infer the coefficients as odds > ratios. > > I first did my model using lm(), but now that I need odd ratios, then should > I have used glm() like displayed here: > >

[R] Extract an invertible submatrix

2016-10-02 Thread Bertrand Marc
Dear R helpers, I am looking for an efficient way to extract (any) one of the biggest invertible submatrix. I have a rectangular matrix A (p x n), with rank k <= min(p, n). I would like to get a submatrix (k x k) invertible, or even better, the list of rows and columns of A which would form

Re: [R] remove a "corrupted file" after using download.file() with R on Windows 7

2016-10-02 Thread Fabien Tarrade
Hi Henrik, 1. It could be that a virus checker locks the file. This is some internal document so I don't think so and this was monitor by our IT security team. 2. There are Windows software tools that identify which process locks a particular file, e.g. LockHunter (http://lockhunter.com/).

Re: [R] remove a "corrupted file" after using download.file() with R on Windows 7

2016-10-02 Thread Fabien Tarrade
Hi Robert, sorry for the delays Sometime download.file() failed to download the file and I would like to remove the correspond file. No answers, but a couple of additional questions: 1) Does the issue persist if you close R or does the file remain locked against deletion? no, if I close R

[R] Histogram using Sturges' Bining Errors

2016-10-02 Thread Elysa Mitova
Histogram using Sturges' bining Hello, I am trying to create a histogram using Sturges' bining rule, yet I keep getting 2 errors, which probably have to do with the variable I am using. Here is my process and the errors, what would you suggest? k <- ggplot (world, aes (x=polstab)) wid <-

[R] Can I get odd ratios from lm() model or only glm()?

2016-10-02 Thread mviljamaa
I'm doing logistic regression and I need to infer the coefficients as odds ratios. I first did my model using lm(), but now that I need odd ratios, then should I have used glm() like displayed here: http://r.789695.n4.nabble.com/Odds-ratio-from-Logistic-model-in-R-td2630277.html

Re: [R] Bootstrapping in R

2016-10-02 Thread ruipbarradas
Right. To see it in action just compare the results of the two calls to boot. library(boot) set.seed(1007) x <- rnorm(100) y <- x + rnorm(100) dat <- data.frame(x, y) #Wrong stat1 <- function(DF, f){ model <- lm(DF$y ~ DF$x, data = DF[f,]) #Doesn't bootstrap DF coef(model) }

Re: [R] Convert a list with NULL to a dataframe with NA

2016-10-02 Thread Bob Rudis
It's fairly straightforward with help from the purrr package: library(purrr) map_df(OB1, function(x) { if (length(x) == 0) { data.frame(id=NA_character_, nam=NA_character_, stringsAsFactors=FALSE) } else { data.frame(id=x[1], nam=names(x), stringsAsFactors=FALSE) } }, .id="V1")

[R] Convert a list with NULL to a dataframe with NA

2016-10-02 Thread Mohammad Tanvir Ahamed via R-help
Hi, I have a list like below. OB1 <- structure(list(aa0 = NULL, aa1 = structure("23403", .Names = "BB10"), aa2 = structure("54904", .Names = "BB20"), aa3 = structure("22897", .Names = "BB30"), aa4 = structure("3751", .Names = "BB40"), aa5 = NULL, aa6 = structure("3679", .Names = "BB50"),

Re: [R] Bootstrapping in R

2016-10-02 Thread peter dalgaard
> On 01 Oct 2016, at 16:11 , Daniel Nordlund wrote: > > You haven't told us anything about the structure of your data, or the > definition of the DataSummary function. Yes. Just let me add that a common error with boot() is not to pay attention to the required form of

Re: [R] installation error

2016-10-02 Thread David Winsemius
> On Oct 1, 2016, at 10:58 AM, > wrote: > > Hello, > > I’m suman kumar. I am trying to use “syuzhet” packages and already installed > it but when using it then facing some error. > I have run these codes but in second line, it is showing errors. >