Re: [R] Hiding message

2011-11-29 Thread Jeff Newmiller
"Don't do that." Use $ notation to refer to elements of lists/data frames explicitly. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

[R] Nomogram with stratified cph in Design package-- failure probability

2011-11-29 Thread min
Hello, I am using Dr. Harrell's design package to make a nomogram. I was able to make a beautiful one. However, I want to change 5-year survival probability to 5-year failure probability. I couldn’t get hazard rate from Hazard(f1) because I used cph for the model. Here is my code: f1 <- cph

Re: [R] Nomogram with stratified cph in Design package-- failure probability

2011-11-29 Thread min
sorry the code for nomogram par(cex=0.8) nom<- nomogram(f1, conf.int=F, fun=list(surv5, surv10), funlabel=c('5-Year Survival Probability', '10-Year Survival Probability' ), lp=F, fun.at=c(at.surv, at.surv),label.every=1, force.label=FALSE, cex.axis=0.8, verbose=TRUE, cex.var=0.8) Thanks Min

Re: [R] Hiding message

2011-11-29 Thread Aldo
It is from attatching and detaching data frames and moving them between functions, there is no library calls in the loop Michael Weylandt wrote > > What does your code look like that you see such messages repeatedly? I > only see those message upon loading a package: maybe move the > library()

[R] Storing the linear model object

2011-11-29 Thread arunkumar1111
Hi Please let me know if we can store the linear model object in the data base and retrive the object and output from them Data<- read.csv("C:/FE and RE.csv") Formula="Y~X2+X3+X4 lmobject = lm(formula=Formula,data=Data) can i store the lm object in the database and and is it possible to retri

Re: [R] Negative exponential fit

2011-11-29 Thread Indrajit Sengupta
What does your error distribution look like? Have you tried any time series analysis on your data? Your information is too little for us to give any concrete directions. Regards, Indrajit From: rch4 To: r-help@r-project.org Sent: Wednesday, November 30, 201

Re: [R] Negative exponential fit

2011-11-29 Thread Indrajit Sengupta
Agreed, nobody has deemed it "default", but is there any other such package that you can think of for this purpose. Regards, From: Uwe Ligges Cc: "r-help@r-project.org" ; rch4 Sent: Tuesday, November 29, 2011 7:33 PM Subject: Re: [R] Negative exponential f

[R] Copula Scale

2011-11-29 Thread cahaya iman
Dear All, I have one questions about *Matrix U* which using to obtain copula parameter. For example when *Matrix U* (*n-*by-2) contains data transformed to the unit hypercube by parametric estimates of their marginal cumulative distribution functions. Did R have build function to obtain this *Ma

Re: [R] Hiding message

2011-11-29 Thread R. Michael Weylandt
What does your code look like that you see such messages repeatedly? I only see those message upon loading a package: maybe move the library() call outside the loop. Also, the suppressPackageStartupMessages() function can hide them, but you should first figure out for yourself why they are there.

[R] Single Variable mlogit formatting

2011-11-29 Thread will_jcd4
Hello, I'm trying to run a mlogit regression on my data, and have been unsuccessful so far. The data I am working with consist of many observations of how people react when given a certain number. I have just 2 data points per observation: a number (there are ~300 different possible numbers) and t

[R] Hiding message

2011-11-29 Thread Aldo
So I am receiving messages in a loop "The following object(s) are masked from..." I tried triedoptions(warn=-1) and options(show.error.message:=FALSE) but it still tells me "The following object(s) are masked from..." repeatedly, and my problem is that it masks the print statement from my fu

Re: [R] Negative exponential fit

2011-11-29 Thread rch4
Thank you for your suggestions. We are currently working with an the nls function, but are having trouble getting a curve that fits our data. We have tried using the following formula: mod1 = nls(time~a*exp(b*(date)), start=list(a=4.178,b=-1.18)) av=mdate bv=predict(mod1,list(mdate=av)) length(av)

Re: [R] Calculating the probability for a logistic regression

2011-11-29 Thread Ben Bolker
sirilkt hotmail.com> writes: > > Hi All, > > When we run the command : summary ( newmod<-gam(Dlq~ formula,family,,data) ) > > in R, the output would the effect of smoothness in R. > > As of now to calculate the probability I am following the below approach: > > 1) Run the plot of the GAM

Re: [R] Parameters setting in functions optimization

2011-11-29 Thread Florent D.
Oh, and your message: In log(LikeGi(l, i, par[1], par[2])) : NaNs produced means your LikeGi is returning something negative. Can't take the log of it... On Tue, Nov 29, 2011 at 8:09 PM, Florent D. wrote: > I also think your last write-up for LogLiketot (using a single > argument "par") is the

Re: [R] Parameters setting in functions optimization

2011-11-29 Thread Florent D.
I also think your last write-up for LogLiketot (using a single argument "par") is the correct approach if you want to feed it to optim(). So now you have a problem with log(LikeGi(l, i, par[1], par[2])) for some values of par[1] and par[2]. Where is LikeGi coming from? a package or is it your ow

Re: [R] R Interface to C / C++‏

2011-11-29 Thread Steve Lianoglou
Hi, IMHO, if you will be focussing mostly in incorporating C/C++ in your own packages you build, instead of wanting to go into other mixed R/C packages to change them up, I'd go with C++ together with the Rcpp package. Rcpp makes lots of things easier on your end, that having been said, you shoul

[R] R Interface to C / C++‏

2011-11-29 Thread Axel Urbiz
Dear List, I’d like to modify the R rpart package source code to add a new split criterion. I’m familiar with R, but not at all with C or C++. I understand C and C++ are quite different, and I don’t have the time to learn both, so my questions are (i) which one should I learn for the specific tas

Re: [R] Problem in log

2011-11-29 Thread Sarah Goslee
On Tue, Nov 29, 2011 at 6:55 PM, Gyanendra Pokharel wrote: > yes, log of negative number is undefined and R also do the same and produces > NaNs. Here I want to reject the value of exp(-alpha*d^(-beta)) when greater > than 1, and want to run the loop otherwise. > Thanks Then just add another if()

Re: [R] Problem in log

2011-11-29 Thread Gyanendra Pokharel
yes, log of negative number is undefined and R also do the same and produces NaNs. Here I want to reject the value of exp(-alpha*d^(-beta)) when greater than 1, and want to run the loop otherwise. Thanks On Tue, Nov 29, 2011 at 6:48 PM, Sarah Goslee wrote: > > Here p[i] <- 1 - exp(-alpha*d^(-beta

Re: [R] Problem in log

2011-11-29 Thread Sarah Goslee
> Here p[i] <- 1 - exp(-alpha*d^(-beta))> so,  log(p[i]) produces NaNs when > exp(-alpha*d^(-beta)) is greater than 1.> How can I remove it.After > generating the out put we can omit it, but the> problem is different. Wait... you're complaining that you can't take the natural log of a negative n

Re: [R] Problem in log

2011-11-29 Thread Gyanendra Pokharel
I have following code: loglikelihood <- function(alpha,beta= 0.1){ loglh<-0 d<-0 p<-0 k<-NULL data<-read.table("epidemic.txt",header = TRUE) attach(data, warn.conflicts = F) k <-which(inftime==1) d <- (sqrt((x-x[k])^2+(y-y[k])^2))^(-beta) p<-1 - exp(-alpha*d)

Re: [R] Nomogram with stratified cph in Design package-- failure probability

2011-11-29 Thread Frank Harrell
Please convert to rms. Design is no longer supported. See http://biostat.mc.vanderbilt.edu/Rrms Frank min wrote > > sorry the code for nomogram > > par(cex=0.8) > nom<- nomogram(f1, conf.int=F, > fun=list(surv5, surv10), funlabel=c('5-Year Survival Probability', > '10-Year Survival Probabilit

[R] error death with backtrace --- how to "exit (0)"

2011-11-29 Thread ivo welch
Dear R experts---I think I need to figure out how to stop in my error function without triggering an error again. so, I think I need the equivalent of C's exit(0) call. Here is what I mean: $ R CMD BATCH die.R and die.R is # in my .Rprofile, but for now in die.R options(error=function(e) print

Re: [R] Create an identifier variable

2011-11-29 Thread R. Michael Weylandt
Forgot the blog http://sas-and-r.blogspot.com/ M On Tue, Nov 29, 2011 at 5:51 PM, R. Michael Weylandt wrote: > Also, this blog has implementations of many common subroutines in both > SAS and R so you can learn "translations" between the two. > > Hope it helps, > > Michael > > On Tue, Nov 2

Re: [R] Create an identifier variable

2011-11-29 Thread R. Michael Weylandt
Also, this blog has implementations of many common subroutines in both SAS and R so you can learn "translations" between the two. Hope it helps, Michael On Tue, Nov 29, 2011 at 5:35 PM, R. Michael Weylandt wrote: > Try something like this: > > Suppose your data object is called df: > > cbind(pa

[R] [R-pkgs] New package 'colorout' to colorize R output on terminal emulators

2011-11-29 Thread Jakson Alves de Aquino
Dear R Community, I'm pleased to announce the availability of 'colorout' on CRAN. The package colorizes R output when it is running on a terminal emulator. Screenshot: http://www.lepem.ufc.br/jaa/R_color_output.png You can use either 16 colors (8 colors * 2 degrees of intensity) or 256 colors to

Re: [R] Create an identifier variable

2011-11-29 Thread R. Michael Weylandt
Try something like this: Suppose your data object is called df: cbind(paste("sd", 1:NROW(df), sep = ""), df) If you are just moving from SAS check out the website (and books associated with) http://r4stats.com -- it's got some tutorials on moving from other platforms to R. Michael On Tue, Nov

Re: [R] Negative exponential fit

2011-11-29 Thread Ben Bolker
rch4 geneseo.edu> writes: > > We need help > > We are doing a project for a statistical class in and we are looking at > world record times in different running events over time. We are trying to > fit the data with a negative exponential but we just cant seem to get a > function that works

Re: [R] Problem in log

2011-11-29 Thread Bert Gunter
Extension to the complex plane? -- Bert Hint: What does the graph of y = log(x) look like? On Tue, Nov 29, 2011 at 2:02 PM, Gyanendra Pokharel wrote: > Hi all I have a function of log defined by y = log(1- exp(-a)), when > exp(-a) is greater, 1, it produce NaN. How can I remove this in R? > >  

Re: [R] Help in determining the formula for a mixed model analysis

2011-11-29 Thread Ben Bolker
Marianne Stephan hotmail.com> writes: > Dear R and statistics experts: > > I have data of a behavioral experiment with the aim to > investigate the effect of a memory task on motor > learning. > > Question: > I would appreciate help in figuring out a > possible formula to determine whether m

Re: [R] Matrix for correlation

2011-11-29 Thread Geophagus
Hi @ all and sorry for the confusion, my problem is solved. I also know a corellation is - it was only a formatting and describing problem. Grant gave me the right advice with the kruskal-wallis! Thanks GeOphagus -- View this message in context: http://r.789695.n4.nabble.com/Matrix-for-correlatio

[R] Create an identifier variable

2011-11-29 Thread hyunjeehale
I am needing to create a new identifier variable for a data set which has no ID variable in the original file. I am basically wanting to take the count of each row and add "sd" in front of it - so it would look like so sd1 sd2 sd3 sd4 sd5 etc... I have no idea how to do this. I am a SAS user

Re: [R] [SOLVED]looking for beta parameters

2011-11-29 Thread Kehl Dániel
I managed to solve the problem myself without using this code. thx 2011-11-24 12:26 keltezéssel, Kehl Dániel írta: > Dear Community, > > I am trying to write code for the following problem. > Lets assume we have a beta distribution. > I know one quantile, lets say, 10% of the mass lies above .8,

Re: [R] Problem in log

2011-11-29 Thread R. Michael Weylandt
Do you mean remove the NaNs? Try na.omit() or complete.cases() or many other options. If you mean you want the complex log, try log(as.complex(1-exp(-a))) Michael On Tue, Nov 29, 2011 at 5:02 PM, Gyanendra Pokharel wrote: > Hi all I have a function of log defined by y = log(1- exp(-a)), when >

[R] Problem in log

2011-11-29 Thread Gyanendra Pokharel
Hi all I have a function of log defined by y = log(1- exp(-a)), when exp(-a) is greater, 1, it produce NaN. How can I remove this in R? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Rich Shepard
On Tue, 29 Nov 2011, Rich Shepard wrote: Pointers on how to determine why this one variable has some values and characters rather than as numerics are needed. Joshua, Marc, David, Bill, Sarah, Bert, et al.: Thank you all for the insights and ideas. It was a valuable lesson and it helped me

Re: [R] I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?

2011-11-29 Thread Gavin Simpson
On Thu, 2011-11-24 at 12:16 +, Edwin Lebrija Trejos wrote: > Hi, First I should note I am relatively new to R so I would appreciate > answers that take this into account. > > I am trying to perform an MDS ordination using the function “metaMDS” > of the “vegan” package. I want to ordinate spe

Re: [R] I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?

2011-11-29 Thread Gavin Simpson
On Thu, 2011-11-24 at 07:57 -0800, B77S wrote: > Try the daisy() function from the package "cluster", it seems to be able to > handle NAs and non-dummy coded character variables > > metaMDS(daisy(df, metric="gower")) That won't help the OP as the species scores (the species data, i.e. the traits

Re: [R] Vegan: Diversity Plot, label points

2011-11-29 Thread Gavin Simpson
On Wed, 2011-11-23 at 16:02 -0300, Alejo C.S. wrote: > Dear List, > > I can'f figure how to add point labels in the next plot (example from > ?taxondive help page): > > library(vegan) > data(dune) > data(dune.taxon) > taxdis <- taxa2dist(dune.taxon, varstep=TRUE) > mod <- taxondive(dune, taxdis)

[R] Help in determining the formula for a mixed model analysis

2011-11-29 Thread Marianne Stephan
Dear R and statistics experts: I have data of a behavioral experiment with the aim to investigate the effect of a memory task on motor learning. Question: I would appreciate help in figuring out a possible formula to determine whether motor learning across sessions differs between 2 groups.

Re: [R] Weird Excel Time Format

2011-11-29 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Hasan Diwan > Sent: Tuesday, November 29, 2011 10:16 AM > To: Prof Brian Ripley > Cc: R Project Help > Subject: Re: [R] Weird Excel Time Format > > On 29 November 2011 09:32, Pro

Re: [R] aggregate syntax for grouped column means

2011-11-29 Thread Justin Haynes
look at just your data that is in that first id category and I bet you can figure it out! > myData[myData$id=='0m11',] var1 var2 id 10 30.79 32.15 0m11 11 30.79 32.39 0m11 12 30.94NA 0m11 aggregate performs the na.rm step on the entire row thus, a mean of 30.79. data.table and plyr pe

Re: [R] aggregate syntax for grouped column means

2011-11-29 Thread Jeff Newmiller
The semantics for na.rm are different for aggregate than for the other options. The former removes any rows that contain an NA prior to performing the computation, the latter methods work column-wise. You have to decide which is correct for your purposes. ---

[R] aggregate syntax for grouped column means

2011-11-29 Thread Juliet Hannah
I am calculating the mean of each column grouped by the variable 'id'. I do this using aggregate, data.table, and plyr. My aggregate results do not match the other two, and I am trying to figure out what is incorrect with my syntax. Any suggestions? Thanks. Here is the data. myData <- structure(l

Re: [R] problem during installing bayesQR package for R 2.14 version

2011-11-29 Thread John C Frain
By any chance is Kalem accessing the Internet through a proxy server which requires a userid and password. There're are instructions in the Windows FAQ on how to deal with this. He may need to obtain some information from his IT department. Alternatively he could download the zip file and install

Re: [R] hour in x-axis

2011-11-29 Thread Justin Haynes
without knowing much about your data or the base plotting... I'd use the library ggplot2. First, you'll need to format your dates to POSIXct AggData$time <- as.POSIXct(AggData$time,format='%H:%M') Then plotting is trivial. ggplot(AggData,aes(x=time,y=value))+geom_points() or +geom_line() if yo

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread William Dunlap
You can see what the offending strings are with > with(waterchem, levels(SC)[is.na(as.numeric(levels(SC)))]) [1] "-" "+" Warning message: In eval(expr, envir, enclos) : NAs introduced by coercion but it may be easiest to use the colClasses argument to read.table to force that column to be n

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Marc Schwartz
On Nov 29, 2011, at 1:18 PM, Rich Shepard wrote: > I have a data frame with 1 factor, one date, and 37 numeric values: > str(waterchem) > 'data.frame': 3525 obs. of 39 variables: > site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ... > $ sampdate : Date, format: "2007-12-12" "20

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread David Winsemius
On Nov 29, 2011, at 2:18 PM, Rich Shepard wrote: I have a data frame with 1 factor, one date, and 37 numeric values: str(waterchem) 'data.frame': 3525 obs. of 39 variables: site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ... $ sampdate : Date, format: "2007-12-12" "2008-03

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Joshua Wiley
Hi Rich, Try looking at: levels(waterchem$SC) There must be something in that column that is triggering R to read it as character. Potential examples include using "." to indicate missing values or anything else that is not itself directly numeric. You might also get some mileadge out of attemp

[R] R help

2011-11-29 Thread Heh Ness
I have a model like this (Nelson and Siegel 1987) http://r.789695.n4.nabble.com/file/n4120161/31f188c684764cd431619dbb59fed5ae.png"; border="0"/> where tau and y are the maturities and yields, respectively, given to me in my data file.. y<-c(4.863,5.662,6.41,6.864,7.153,7.352,7.409,7.474,7.503

[R] Parameters setting in functions optimization

2011-11-29 Thread Diane Bailleul
Good afternoon everybody, I'm quite new in functions optimization on R and, whereas I've read lot's of function descriptions, I'm not sure of the correct settings for function like "optimx" and "nlminb". I'd like to minimize my parameters and the loglikelihood result of the function. My paramet

[R] Calculating the probability for a logistic regression

2011-11-29 Thread sirilkt
Hi All, When we run the command : summary ( newmod<-gam(Dlq~ formula,family,,data) ) in R, the output would the effect of smoothness in R. As of now to calculate the probability I am following the below approach: 1) Run the plot of the GAM , interpret the curves 2) Re Run the Regression a

[R] hour in x-axis

2011-11-29 Thread threshold
Dear R useres, got the following problem. Given the AggData (listed below) I need to plot AggData[,2] vs time (AggData[,1]) for chosen 'rows'. Ive done already: plot(AggData[rows,2], xaxt='n') axis(1,at=seq(1,length(rows),1),sub("","", AggData[rows,1])) which works, but I need to list only chose

Re: [R] Transforming a string into a command

2011-11-29 Thread Xu Wang
Petr, thanks for pointing that out. Jim, you are exactly right! Thank you for catching that. I did not realize in the other replies that they were using log and not ln. David, thank you for the lessons. I will improve my question asking skills. Thanks to all, Xu On Tue, Nov 29, 2011 at 9:31 AM,

[R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Rich Shepard
I have a data frame with 1 factor, one date, and 37 numeric values: str(waterchem) 'data.frame': 3525 obs. of 39 variables: site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ... $ sampdate : Date, format: "2007-12-12" "2008-03-15" ... $ CO3 : num 1 1 6.7 1 1 1 1 1 1

Re: [R] Weird Excel Time Format

2011-11-29 Thread Kevin E. Thorpe
On 11/29/2011 01:39 PM, Hasan Diwan wrote: On 29 November 2011 10:26, Jeff Newmiller wrote: For my part, I highly recommend exporting to CSV before importing to R. Will look into doing so... I don't think this point can be stressed enough. I have had too many bad experiences with dates i

Re: [R] Weird Excel Time Format

2011-11-29 Thread Hasan Diwan
On 29 November 2011 10:26, Jeff Newmiller wrote: > You haven't indicated how you are accessing the Excel file, or whether it is > an XLS or XLSX file. It sounds like you might be using rcom or a dependent > package, in which case you may need to read the Excel COM interface > documentation more

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread Jeff Newmiller
Omitting the leading zero is dangerous, since the decimal point can disappear in a poor hardcopy leading to later misinterpretation. --- Jeff NewmillerThe . . Go Live... DCN:B

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread William Dunlap
You may also want to deal with a possible leading negative sign: > lambda <- c(0, 0.005, 0.01, 0.02, 0.04, 0.08, -0.005, -0.01, -0.02, -0.04, -0.08, 1000) > gsub("^0(\\..*[^0])0*$","\\1", lambda) [1] "0" ".005" ".01"".02"".04"".08" [7] "-0.005" "-0.01

Re: [R] Weird Excel Time Format

2011-11-29 Thread Jeff Newmiller
You haven't indicated how you are accessing the Excel file, or whether it is an XLS or XLSX file. It sounds like you might be using rcom or a dependent package, in which case you may need to read the Excel COM interface documentation more carefully. In any event, you can't expect as.Date to und

Re: [R] Weird Excel Time Format

2011-11-29 Thread Hasan Diwan
On 29 November 2011 09:32, Prof Brian Ripley wrote: > If all else fails, read the help page.  There are examples on ?as.Date of > reading Excel dates. I did, it seems there is either (a) a problem with my code, or (b) a problem with the documentation. See below: > rawtimeColumn [1] 39406.577662037

Re: [R] Making the lines thicker in histogram

2011-11-29 Thread Jean V Adams
kerry1912 wrote on 11/29/2011 09:51:34 AM: > > I'm using a histogram and want to overlay this onto a barplot. I need the > histogram lines to be thicker in order for it to stand out more on top of > the barplot. Is there a command in order to do this? > > Thanks in advance. This topic has be

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread Bert Gunter
.. and if you want to simultaneously handle possible multiple trailing zeros (not sure whether this could even happen) (somewhat but not completely tested) > lambda <- c(0, 0.005, 0.01, 0.02, 0.04, 0.08) > gsub("^0(\\..*[^0])0*$","\\1",lambda) [1] "0"".005" ".01" ".02" ".04" ".08" Note th

Re: [R] Weird Excel Time Format

2011-11-29 Thread Prof Brian Ripley
If all else fails, read the help page. There are examples on ?as.Date of reading Excel dates. But I don't believe the time you give. (0.577662037 is just before 13:51:50). On Tue, 29 Nov 2011, Hasan Diwan wrote: I have a 10-column XLS file, with 2 date fields. As far as I can tell, they we

Re: [R] format numbers without leading or trailing 0s

2011-11-29 Thread Sarah Goslee
Here's one way to get rid of leading zeros before the decimal point: > gsub("^0\\.", "\\.", as.character(lambda)) [1] "0"".005" ".01" ".02" ".04" ".08" Sarah On Tue, Nov 29, 2011 at 12:04 PM, Michael Friendly wrote: > A simple question, but I can't find something to do what I want: > > G

[R] format numbers without leading or trailing 0s

2011-11-29 Thread Michael Friendly
A simple question, but I can't find something to do what I want: Given: a vector of numbers, like lambda <- c(0, 0.005, 0.01, 0.02, 0.04, 0.08) Desired: format them in minimal space for use as plot labels, ie, without leading or tailing 0s. For this example: lambdaf <- c("0", .005", ".01", "

[R] Weird Excel Time Format

2011-11-29 Thread Hasan Diwan
I have a 10-column XLS file, with 2 date fields. As far as I can tell, they were configured identically in Excel 2010. One of these fields resembles "39406.577662037", whilst in Excel, it is shown as "2007-11-20 13:42:20". Applying as.Date() with the default format doesn't do it. Any ideas as to wh

[R] Notation

2011-11-29 Thread Silvano
Hi, what's mean "/" in command: betareg(inf~Grupo/Sexo, data=dados) it's a effect nested? -- Silvano Cesar da Costa Departamento de Estatística Universidade Estadual de Londrina Fone: 3371-4346 __ R-help@r-project

Re: [R] Matrix for correlation

2011-11-29 Thread R. Michael Weylandt
I think everyone is worried about your data, not what a correlation matrix is. Now I think you may be even more turned around: you want a correlation between the values of the correlation matrix? Just dput() your data object and copy it into your email and we'll see if it's possible to calculate a

Re: [R] Matrix for correlation

2011-11-29 Thread Geophagus
Hi Michael, thank you so much for your fast reply. On the image below there is an example of what I mean. I need the correlation between the values on the fields with "?". http://r.789695.n4.nabble.com/file/n4119734/corr_ex.png But my source data is not in a matrix. It looks like the table in

[R] Making the lines thicker in histogram

2011-11-29 Thread kerry1912
I'm using a histogram and want to overlay this onto a barplot. I need the histogram lines to be thicker in order for it to stand out more on top of the barplot. Is there a command in order to do this? Thanks in advance. -- View this message in context: http://r.789695.n4.nabble.com/Making-the-li

Re: [R] Help needed in reproducing a plot

2011-11-29 Thread Dennis Murphy
Hi: This looks like the one: library('lattice') data(Oats, package = 'MEMSS') print(xyplot(yield ~ nitro | Block, Oats, groups = Variety, type = c("g", "b"), auto.key = list(lines = TRUE, space = 'top', columns = 3), xlab = "Nitrogen concentration (cwt/acre)",

Re: [R] Matrix for correlation

2011-11-29 Thread Grant McDonald
Do you have multiple data points for Car/Train etc? And do you want to see if there are differences between in mean/medians these modes of transport? If so explore anova, kruskal-wallis . > Date: Tue, 29 Nov 2011 16:57:57 +0100 > From: lig...@statistik.tu-dortmund.de > To: falk.hilli...@tw

Re: [R] Decision Trees /Decision Analysis with R?

2011-11-29 Thread ianjacob
Hi, Unfortunately I do not have an answer to this question yet, but it is something I'm currently examining. We're hoping to construct a template for health economic evaluation using decision tree (eventually working up to more complex modelling methodologies). I'll keep you posted on our progress

Re: [R] quick ANOVA question

2011-11-29 Thread S Ellison
> -Original Message- > What I like to know is if I apply an ANOVA to this data and > choose the control group as the reference group (using the > relevel function) what groups exactly are compared? Are only > all treated groups 1, 2, 3 tested against the control group > or are all possi

Re: [R] Matrix for correlation

2011-11-29 Thread Uwe Ligges
On 29.11.2011 16:41, Geophagus wrote: hi @ all, I have problem with creating a matrix for a cor() function. I try to use the cor() function on a matrix to test the correlation between each value in a column. Maybe like corr(x, method = xyz). My x has two columns maybe like this: MEDIA VALUE C

Re: [R] Matrix for correlation

2011-11-29 Thread R. Michael Weylandt
I'm not sure how you mean to calculate correlation if you have a single observation of each mediumcan you provide your data (or a subset thereof) so we can see what you are actually working with and if correlation makes sense. Michael On Tue, Nov 29, 2011 at 10:41 AM, Geophagus wrote: > hi @

Re: [R] Help needed in reproducing a plot

2011-11-29 Thread jim holtman
Looks like a typical plot produced using the 'lattice' package. There is plenty of documentation on the use of the package. Run some of the examples. On Tue, Nov 29, 2011 at 10:43 AM, syrvn wrote: > Hello, > > > can anybody tell me how to produce a plot like the one in > > http://cran.r-project

[R] Matrix for correlation

2011-11-29 Thread Geophagus
hi @ all, I have problem with creating a matrix for a cor() function. I try to use the cor() function on a matrix to test the correlation between each value in a column. Maybe like corr(x, method = xyz). My x has two columns maybe like this: MEDIA VALUE Car 23 Train26 Plane 25 Cab

Re: [R] Extracting from zip, removing certain file extensions

2011-11-29 Thread Mathew Brown
Great, many thanks. On 11/29/2011 3:09 PM, Duncan Murdoch wrote: On 29/11/2011 8:36 AM, Mathew Brown wrote: Hi there, I'm running R on windows 7 with Rstudio. Everyday I receive a zip file where a bunch of half-hourly files are zipped together. I then use xx=unzip(ind) to get xx, which consi

Re: [R] fill binary matrices with random 1s

2011-11-29 Thread Dennis Murphy
Hi: Here's one approach. I assume that your first 1000 matrices have a single 1 in each matrix, the next set of 1000 have two 1's, ..., and the last one has 99 1's. (No point in doing all 1's since they're all constant.) If that's the case, then try the following. # Each row represents a differen

[R] Problems with Raster and clim.pact packages with large netcdf files (2.7G) in x64 bit R

2011-11-29 Thread Emmanuel Jjunju
I normally use the raster or clim.pact pckages to read netcdf (.nc) files. This has always worked out for me until this weekend every time i try to read a .nc file i get the following error Program: C:\Program Files\RStudio\bin\x64\rsession.exe File: posixio.c, Line 417 Expression: offset >= 0 Thi

[R] Help needed in reproducing a plot

2011-11-29 Thread syrvn
Hello, can anybody tell me how to produce a plot like the one in http://cran.r-project.org/web/packages/lme4/vignettes/Implementation.pdf on page 13, Figure 6? The data is stored in: library(nlme) data(Oats) Cheers -- View this message in context: http://r.789695.n4.nabble.com/Help-neede

Re: [R] fill binary matrices with random 1s

2011-11-29 Thread David Winsemius
On Nov 29, 2011, at 7:32 AM, Grant McDonald wrote: Dear all, I am finding difficulty in the following, I would like to create an empty matrix e.g. 10x10 of 0s and sequentially fill this matrix with randomly placed a 1s until it is saturated. Producing 100 matrices of sequentially increasing de

Re: [R] fill binary matrices with random 1s

2011-11-29 Thread Bert Gunter
Folks: On Tue, Nov 29, 2011 at 6:24 AM, Sarah Goslee wrote: > I have to admit I'm not entirely sure what your question is. How to > put a 1 in a random position in a matrix? > > mat <- matrix(0, 10, 10) >  mat[sample(1:nrow(mat), 1), sample(1:ncol(mat), 1)] <- 1 This is unnecessary. In R: matrice

Re: [R] x, y for point of intersection

2011-11-29 Thread Monica Pisica
Hi again, Working with my real data and not with the little example i sent to the list i discovered that segm_distance function from package "pracma" does not converge to 0 in all cases, even if i increase the number of iteration to 10,000 for example. It seems that it depends on the "initiali

Re: [R] regarding installation of bayesQR package

2011-11-29 Thread Uwe Ligges
On 29.11.2011 13:09, narendarreddy kalam wrote: i have R 2.14 2.14.0 I guess. version.and i have downloaded bayesQR package from following link http:// http://cran.r-project.org/web/packages/bayesQR/index.ht ml my OS is Windows7.i have downloaded Windows binary:bayesQR_1.3.zip file

Re: [R] Transforming a string into a command

2011-11-29 Thread David Winsemius
On Nov 29, 2011, at 2:30 AM, Xu Wang wrote: David, Did my reply get orphaned All replies are "orphaned". You are asked to include context if your question relies on code that has previously been posted. or are you trying to help me realize that asking why something does not work is not

Re: [R] heatmap.2 (blurred output heatmap)

2011-11-29 Thread Uwe Ligges
example(heatmap.2) works for me, hence it is either your data, your version of some package or your version of R that causes the problems, we do not have information of any of these although the posting guide asks you to provide this for each posting. So we cannot help. Uwe Ligges On 29.11.2

Re: [R] Bayesian Quantile regression installation

2011-11-29 Thread Sarah Goslee
Let's see... you could: - read the directions at http://cran.r-project.org or the longer ones here http://cran.r-project.org/doc/manuals/R-admin.pdf - look at the help for install.packages() - actually look at the menus for R, as there's an install from local file option there somewhere in the Wind

Re: [R] fill binary matrices with random 1s

2011-11-29 Thread Sarah Goslee
I have to admit I'm not entirely sure what your question is. How to put a 1 in a random position in a matrix? mat <- matrix(0, 10, 10) mat[sample(1:nrow(mat), 1), sample(1:ncol(mat), 1)] <- 1 will do so, but if you need to fill a random position that is *currently zero* then you'll need to wrap i

Re: [R] Extracting from zip, removing certain file extensions

2011-11-29 Thread Duncan Murdoch
On 29/11/2011 8:36 AM, Mathew Brown wrote: Hi there, I'm running R on windows 7 with Rstudio. Everyday I receive a zip file where a bunch of half-hourly files are zipped together. I then use xx=unzip(ind) to get xx, which consists of : [1] "./2011/A20112961503.flx" "./2011/A20112961503.log" ".

Re: [R] Negative exponential fit

2011-11-29 Thread Uwe Ligges
On 29.11.2011 07:06, Indrajit Sengupta wrote: What have you tried so far - can you explain? "fitdistrplus" package is the default package for fitting distributions. It is a contributed packages, and perhaps it is a good one (I do not know), but calling it the *default* ... who defined that?

Re: [R] append to PDF file

2011-11-29 Thread Uwe Ligges
On 29.11.2011 13:15, R. Michael Weylandt wrote: I think you are looking for the system() command. ... and you certainly do not want to use savePlot but rather use the pdf() device directly. Uwe Ligges Michael On Tue, Nov 29, 2011 at 7:11 AM, Christof Kluß wrote: Hi Jim, Hi Ken Am 27

Re: [R] Extracting from zip, removing certain file extensions

2011-11-29 Thread jim holtman
use pattern matching (regular expressions): e.g., myFileNames[grepl("slt$", myFileNames)] On Tue, Nov 29, 2011 at 8:36 AM, Mathew Brown wrote: > > > Hi there, > I'm running R on windows 7 with Rstudio. Everyday I receive a zip file > where  a bunch of half-hourly files are zipped together. > I

[R] heatmap.2 (blurred output heatmap)

2011-11-29 Thread Stuart
Hi I used to make heatmaps using following commands but now some thing has changed as I get library(gplots) heatmap. 2(qtl.map,Rowv=F,dendrogram="column",col=colorRampPalette(c("blue","lightblue","black","black","yellow","red")),breaks=seq(-4.01,4.01,length.out=51), density.info="none", ) follow

[R] Extracting from zip, removing certain file extensions

2011-11-29 Thread Mathew Brown
Hi there, I'm running R on windows 7 with Rstudio. Everyday I receive a zip file where a bunch of half-hourly files are zipped together. I then use xx=unzip(ind) to get xx, which consists of : [1] "./2011/A20112961503.flx" "./2011/A20112961503.log" "./2011/A20113211730.slt" "./2011/A201132118

[R] Any function\method to use automatically Final Model after bootstrapping using boot.stepAIC()

2011-11-29 Thread aajit75
Hi List, Being new to R, I am trying to apply boot.stepAIC() for Model selection by bootstrapping the stepAIC() procedure. I had gone through the discussion in various thread on the variable selection methods. Understood the pros and cons of various method, also going through the regression modelli

[R] fill binary matrices with random 1s

2011-11-29 Thread Grant McDonald
Dear all, I am finding difficulty in the following, I would like to create an empty matrix e.g. 10x10 of 0s and sequentially fill this matrix with randomly placed a 1s until it is saturated. Producing 100 matrices of sequentially increasing density., This process needs to be randomized 1000 ti

  1   2   >