[R] invalid function value in 'nlm' optimizer

2015-04-27 Thread Hanze Zhang
Hi, R users, I am using nlm function to get the MLE of parameter alpha and lambda from a parametric survival model (Weibull distribution). However, this message always came out: ' invalid function value in 'nlm' optimizer'. Could anyone help me? Code is project<-read.table(file="C://data.txt",

Re: [R] Distribution to use to calculate p values

2015-04-27 Thread Jim Lemon
Hi Lalitha, If you want to find a reasonable model distribution for your data, try plotting the histogram of the variable you want to predict and compare this to the density curves of the distributions that you think will fit. So for example: # plot a histogram of a uniform distribution hist(seq(1

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread John Kane
Looks great. How come so many NA's in Height and BMI? Just no data available? str(dat1) 'data.frame': 100 obs. of 8 variables: $ Id : int 7451 148 10393 10200 1961 10428 10541 10012 9895 10626 ... $ Level : Factor w/ 5 levels "CHAMPIONSHIP",..: 1 1 1 1 1 1 1 1 1 1 ... $ AgeGr :

Re: [R] select portion of text file using R

2015-04-27 Thread Duncan Mackay
Hi Luigi I think there may be problems with \t being equivalent to tab chr(9) Therefore try xlines <- readLines(textConnection("* Block Type = Array Card Block * Calibration Background is expired = No * Calibration Background performed on = 2014-12-02 11:27:49 AM PST * Calibration FAM is expired

Re: [R] select portion of text file using R

2015-04-27 Thread jim holtman
try this. It read in all the data and discards the lines not required. > # read in the data and delete lines not required > data_in <- readLines(textConnection("HEAD OF MYDATA + * Block Type = Array Card Block + * Calibration Background is expired = No + * Calibration Background performed on =

Re: [R] select portion of text file using R

2015-04-27 Thread Duncan Murdoch
On 27/04/2015 5:20 PM, Luigi Marongiu wrote: > Dear Duncan, > thank you for your reply, > I tried to read the file using skip and nrows but it did not work. What does that mean? We might be able to be more help if you tell us what happened when you tried the code below. > Here i am pasting the c

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread Joshua Dixon
Thanks John! This ok? > dput(head(data, 100)) structure(list(Id = c(7451L, 148L, 10393L, 10200L, 1961L, 10428L, 10541L, 10012L, 9895L, 10626L, 1151L, 8775L, 10083L, 6217L, 90L, 10168L, 10291L, 8549L, 3451L, 10003L, 5907L, 10136L, 6182L, 6315L, 10015L, 9956L, 2040L, 4710L, 10747L, 6787L, 1222L, 10

Re: [R] DeSolver giving "NA" as output, but running fully.

2015-04-27 Thread John Kane
Data? Use deput() (see ?dput) to provide some sample data. Also you might find this useful http://adv-r.had.co.nz/Reproducibility.html John Kane Kingston ON Canada > -Original Message- > From: walke...@umn.edu > Sent: Mon, 27 Apr 2015 13:34:54 -0700 (PDT) > To: r-help@r-project.org

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread John Kane
Hi Josh, Just a sample is usually fine. As long as it cover a representative (must be time for dinner---I was going to type reprehensibe) sample of the data then something like dput(head(mydata, 100) ) works well. Kingston ON Canada -Original Message- From: joshuamichaeldi...@gmai

Re: [R] select portion of text file using R

2015-04-27 Thread Luigi Marongiu
Dear Duncan, thank you for your reply, I tried to read the file using skip and nrows but it did not work. Here i am pasting the code I wrote and the head of the file i need to read. Probably the error is due to the fact that the column "well" has duplication, but how can i add a row column with uni

Re: [R] Question about base::rank results

2015-04-27 Thread David L Carlson
Apologies if this belabors the point, but let's look at your second example to see why order and rank are different: > x <- c(12,34,15,77,78,22) > names(x) <- 1:6 > x 1 2 3 4 5 6 12 34 15 77 78 22 I've added names to the values so we can watch how they change. If we sort the numbers we g

[R] DeSolver giving "NA" as output, but running fully.

2015-04-27 Thread walke554
Hello All, I am currently looking on a transmission model for STD transmission within a population. I am able to run my full code and the ODE function, but when I look at my output, all I get is "NA" for each time step beyond the first. There doesn't seem to be any syntax error, and I do get my

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread Joshua Dixon
Apologies for my ignorance! *Thierry* - thank you for the reading. I'll look into those ASAP! *John* - The data set I have is quite large, when using the dput() command I'm unsure if it actually fits the whole output into the console. I can't scroll up far enough to see the actual command. I c

Re: [R] Question about base::rank results

2015-04-27 Thread J Robertson-Burns
There is a blog post on this topic: http://www.portfolioprobe.com/2012/07/26/r-inferno-ism-order-is-not-rank/ Pat On 26/04/2015 09:17, Giorgio Garziano wrote: Hi, I cannot understand why rank(x) behaves as outlined below. Based on the results of first x vector values ranking, which is as expe

Re: [R] Distribution to use to calculate p values

2015-04-27 Thread David Winsemius
On Apr 27, 2015, at 10:50 AM, Lalitha Viswanathan wrote: > Hi > I have a dataset as below > Price Country Reliability Mileage Type Weight Disp. HP > > > 8895 USA 4 33 Small 2560 97 113 > (Hundreds of rows) > > I am trying to find the best possible distribution to use, to find p-values > and co

[R] Fwd: Distribution to use to calculate p values

2015-04-27 Thread Lalitha Viswanathan
Hi I have a dataset as below Price Country Reliability Mileage Type Weight Disp. HP 8895 USA 4 33 Small 2560 97 113 (Hundreds of rows) I am trying to find the best possible distribution to use, to find p-values and compute which factors most influence efficiency. Any starting points for the fun

Re: [R] Interactive maps

2015-04-27 Thread Ben Tupper
Hi, You may want to redirect your question to the R-sig-Geo mailing list: https://stat.ethz.ch/mailman/listinfo/r-sig-geo In the meantime, you might consider writing to the 'rasterfile' format. The 'rasterfile' format is very well documented and is to read/write from R; I suspect it would ea

Re: [R] Interactive maps

2015-04-27 Thread Antonio Serrano via R-help
Ok. The point now is that I have the sources (in Fortran) of the program that produces the graph with the map. And have to attach the information about the xrange and yrange to this graph in order for them to be read from R. Id est, I have to write: first longitude, first latitude, last lo

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread Michael Dewey
Dear Joshua It would also help if you told us what your scientific question was. At the moment we know what R commands you used and have seen the head of your dataset but not why you are doing it. I would summarise what you have given us as 1 - most ID only occur once 2 - goal keepers do wor

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread John Kane
John Kane Kingston ON Canada > -Original Message- > From: joshuamichaeldi...@gmail.com > Sent: Mon, 27 Apr 2015 08:54:51 +0100 > To: thierry.onkel...@inbo.be > Subject: Re: [R] Help Interpreting Linear Mixed Model > > Hello Thierry, > > No, this isn't homework. Not that young unfortun

Re: [R] Question about base::rank results

2015-04-27 Thread Giorgio Garziano
Ok. Thanks for your explanation. Cheers, Giorgio Garziano -Original Message- From: Rolf Turner [mailto:r.tur...@auckland.ac.nz] Sent: lunedì 27 aprile 2015 09:24 To: Giorgio Garziano; r-help@r-project.org Subject: Re: [R] Question about base::rank results On 26/04/15 20:17, Giorgio Garz

Re: [R] Question about base::rank results

2015-04-27 Thread John Kane
Ah, thanks. That makes sense. John Kane Kingston ON Canada > -Original Message- > From: petr.pi...@precheza.cz > Sent: Mon, 27 Apr 2015 08:29:36 + > To: giorgio.garzi...@ericsson.com, r-help@r-project.org > Subject: Re: [R] Question about base::rank results > > Hi > > You want to

Re: [R] Mean of dates

2015-04-27 Thread Jue Lin-Ye
On 24 April 2015 at 13:47, Jue Lin-Ye wrote: > > > On 24 April 2015 at 12:59, Achim Zeileis wrote: > >> >> >> On Fri, 24 Apr 2015, Jue Lin-Ye wrote: >> >> Dear fellow R-help members, >>> >>> If my data is >>> >>> MM DD HH >>> 2015 04 24 01 >>> 2015 04 24 02 >>> 2015 04 24 06 >>> >>> Where

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread Thierry Onkelinx
Hello Josh, One is never too old to study ;-) Your question seems quite broad. You might be better off to read some books on mixed models (e.g. Pinheiro & Bates (2000) or Zuur et al (2009)) or try to find a local statistician. Email is not a suitable medium to teach statistics. Note that r-sig-m

Re: [R] Question about base::rank results

2015-04-27 Thread PIKAL Petr
Hi You want to use order. rank gives you position of x according their values. > x <- c(12,34,15,77,78,22) > rank(x) [1] 1 4 2 5 6 3 order gives you sorting vector to get your values in ascending or descending order. > order(x) [1] 1 3 6 2 4 5 > x[order(x)] [1] 12 15 22 34 77 78 You can see

Re: [R] How to calculate vif of each term of model in R?

2015-04-27 Thread PIKAL Petr
Hi Better to use dput(xsys) output as it preserves your actual data. Other answers see in line > -Original Message- > From: Methekar, Pushpa (GE Transportation, Non-GE) > [mailto:pushpa.methe...@ge.com] > Sent: Monday, April 27, 2015 8:37 AM > To: PIKAL Petr > Subject: RE: How to calcula

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread Joshua Dixon
Hello Thierry, No, this isn't homework. Not that young unfortunately. Josh > On 27 Apr 2015, at 08:06, Thierry Onkelinx wrote: > > Dear Josh, > > Is this homework? Because the list has a no homework policy. > > Best regards, > > ir. Thierry Onkelinx > Instituut voor natuur- en bosonderzoek

Re: [R] Question about base::rank results

2015-04-27 Thread Rolf Turner
On 26/04/15 20:17, Giorgio Garziano wrote: Hi, I cannot understand why rank(x) behaves as outlined below. Based on the results of first x vector values ranking, which is as expected in my opinion, I cannot explain the following results. x <- c(12,34,15,77,78) x[rank(x)] [1] 12 15 34 77 78

Re: [R] Help Interpreting Linear Mixed Model

2015-04-27 Thread Thierry Onkelinx
Dear Josh, Is this homework? Because the list has a no homework policy. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belg

[R] Number formatting of labels in directlabels with stat_contour (ggplot2)

2015-04-27 Thread Dominic Roye
How can I customize the number formatting of labels in directlabels? It should be integer as in the original dataset. p <- ggplot(temp,aes(lon,lat,z=Pres,colour=..level..))+ stat_contour(bins=30,size=0.5,colour="black")+theme_bw() direct.label(p,list("top.pieces",cex=0.7,colour="red")

[R] Help Interpreting Linear Mixed Model

2015-04-27 Thread Joshua Dixon
Hello! Very new to R (10 days), and I've run the linear mixed model, below. Attempting to interpret what it means... What do I need to look for? Residuals, correlations of fixed effects?! How would I look at very specific interactions, such as PREMIER_LEAGUE (Level) 18 (AgeGr) GK (Position) mean

[R] Question about base::rank results

2015-04-27 Thread Giorgio Garziano
Hi, I cannot understand why rank(x) behaves as outlined below. Based on the results of first x vector values ranking, which is as expected in my opinion, I cannot explain the following results. > x <- c(12,34,15,77,78) > x[rank(x)] [1] 12 15 34 77 78 (OK) > x <- c(12,34,15,77,78,22) > x[ra