[R] Background fill and border for a legend in dotplot

2011-09-02 Thread markm0705
Dear R help group I've been working on this plot for a while now and now getting around to the minor adjusments. I would like to be able to put a border and background fill around the legend in this plot. I understand the legend 'bty' should do this have this capablity but not sure how the

[R] Urgente

2011-09-02 Thread Frank Mill
- This mail is in HTML. Some elements may be ommited in plain text. - Meu nome é Frank P, eu trabalhei com o Banco SNS em Holland.I habe Você contactado por conta de parente falecido com os nossos Banj e que foi deixado sem pretensões. Por favor, me envia um email com um número de telefone e

Re: [R] Question about BIC of two different regression models? how should we compare two regression models?

2011-09-02 Thread Ben Bolker
Andra Isan andra_isan at yahoo.com writes: Hi All,  In order to compare two different logistic regressions, I think I need to compare them based on their BIC values, but I am not sure if the smaller BIC would mean a better model or the reverse is true? Thanks a lot,Andra Smaller

Re: [R] two question about plot

2011-09-02 Thread Petr PIKAL
Hi Re: [R] two question about plot The help for boxplot offers suggestions for both those things. You may be particularly interested in: names: group labels which will be printed under each boxplot. Can be a character vector or an expression (see plotmath). add:

Re: [R] ggplot2 to create a square plot

2011-09-02 Thread Paul Hiemstra
On 09/01/2011 09:02 PM, baptiste auguie wrote: Hi, Are you after this? last_plot() + opts(aspect.ratio=1) Even better (I once got correct by Hadley for using aspect.ratio, but this was plotting spatial data...) last_plot() + coord_equal() cheers, Paul Also, see

Re: [R] ggplot2 to create a square plot

2011-09-02 Thread Alaios
Dear Dennis, I wouldl ike to thank you for your answer. That did it work. how can I know remove the space between the axis labels and the image (blue-red area)? Right now things look like are floating a bit. I want the x,y labels to reduce the overall gap. I would like to thank you in advance

Re: [R] Automatic Recoding

2011-09-02 Thread thomas.chesney
Thank you both for your replies. I've tried it with a small sample of the data and it works perfectly. I have no idea yet how it works but I will spend some time to figure it out. Thank you! Thomas -- View this message in context:

[R] calling R from PHP error

2011-09-02 Thread Katerina Karayianni
Hello, I am having the following error while calling an R script through PHP. /usr/local/bin/R: line 227: /kk/Programs/R-2.13.0/etc/ldpaths: Permission denied ERROR: R_HOME ('/kk/Programs/R-2.13.0') not found I had compiled R from source and placed the generated R shell script in /usr/local/bin.

[R] Re : P values for vglm(zibinomial) function in VGAM

2011-09-02 Thread justin bem
Estimation is realized by MLE, estimators are asymptotically normal Try this reg-vglm(...) p.value-1-pnorm(abs(coef(reg)/sqrt(diag(vcov(reg)   Justin BEM BP 1917 Yaoundé Tél (237) 76043774 De : suuz suuz_b...@hotmail.com À : r-help@r-project.org Envoyé le

[R] Using capture.output within a function

2011-09-02 Thread Kristian Lind
Dear R-users I'm running a maximum likelihood procedure using the spg package. I'd like to save some output produced in each iteration to a file, but if I put the capture.output() within the function I get the following message; Error in spg(par = startval, fn = loglik, gr = NULL, method = 3,

[R] Maximum Likelihood using optim()

2011-09-02 Thread Thiem Alrik
Dear mailing list, I would like to use the optim() command in order to maximize the logged likelihood of the following function, where p is the parameter of interest and should be constrained between 0 and positive infinity. y = 1/2 * ((te - x)/(te - tc))^p x and y are given by x - c(5.18,

[R] [R-pkgs] hydroTSM 0.3-0 and hydroGOF 0.3-0

2011-09-02 Thread Mauricio Zambrano-Bigiarini
Dear R users and hydrological/environmental community, I'm glad to announce that a major (and recommended) update for the packages hydroTSM and hydroGOF are now available on CRAN: -) hydroTSM: http://cran.r-project.org/web/packages/hydroTSM/ -) hydroGOF:

Re: [R] betareg question - keeping the mean fixed?

2011-09-02 Thread betty_d
Thanks for your response, that does work, however, it is still not quite what want. I would like to tell betareg what the mean is (in my case, 0.5) and force it to use that value. Is this possible? -- View this message in context:

Re: [R] Using capture.output within a function

2011-09-02 Thread Duncan Murdoch
On 11-09-02 5:24 AM, Kristian Lind wrote: Dear R-users I'm running a maximum likelihood procedure using the spg package. I'd like to save some output produced in each iteration to a file, but if I put the capture.output() within the function I get the following message; Error in spg(par =

Re: [R] Advice on large data structures

2011-09-02 Thread Jim Holtman
i would suggest that if you want to use R that you get a 64-bit version with 24GB of memory to start. if your data is a numeric matrix, you will need 8GB for a single copy. Do you really need it all in memory at once, or can you partition the problem? Can you use a database to access the

Re: [R] Using capture.output within a function

2011-09-02 Thread Kristian Lind
Yes, that's true. It works as it's supposed to now. Thank you. Kristian Lind 2011/9/2 Duncan Murdoch murdoch.dun...@gmail.com On 11-09-02 5:24 AM, Kristian Lind wrote: Dear R-users I'm running a maximum likelihood procedure using the spg package. I'd like to save some output produced in

[R] If NA Problem!

2011-09-02 Thread Anna Dunietz
Hi All! Please find code and the respective lists below. My problem: I specify the case that lilwin[[p]] is not an NA and want the code found in iwish to be returned ONLY for that case. Why do I get a list of length 2 (and why is NULL the first element)? I understand that the code below is

Re: [R] Background fill and border for a legend in dotplot

2011-09-02 Thread Dennis Murphy
Hi: Try this: key1 - draw.key(list(text=list(levels(Cal_dat$Commodity)), title=Ore type, border = TRUE, background = 'ivory', points=list(pch=22, cex=1.3, fill=col.pat, col=black)), draw = FALSE) key2 -

[R] merge some columns

2011-09-02 Thread Joao Fadista
Dear all, I would like to know how to merge columns like: Input file: V1 V2 V3 V4 V5 V6 1 G A G G G G 2 A A G A A G Desired output file: V1 V2 V3 1 G/A G/G G/G 2 A/A G/A A/G So for every 2 consecutive columns merge their content into one. Thanks in advance.

Re: [R] If NA Problem!

2011-09-02 Thread Jean V Adams
Anna Dunietz wrote on 09/02/2011 07:16:45 AM: Hi All! Please find code and the respective lists below. My problem: I specify the case that lilwin[[p]] is not an NA and want the code found in iwish to be returned ONLY for that case. Why do I get a list of length 2 (and why is NULL the

Re: [R] Question about BIC of two different regression models? how should we compare two regression models?

2011-09-02 Thread John Sorkin
I believe when using BIC one needs to compare nested models, i.e. , when comparing models A and B one must make sure that model A contains all the parameters of model B and additionally A contains one or more extra parameter beyond those in B. Further the comparison of BICs requires that models

Re: [R] merge some columns

2011-09-02 Thread Dennis Murphy
Hi: Here's one approach: d - read.table(textConnection( V1 V2 V3 V4 V5 V6 1 G A G G G G 2 A A G A A G), header = TRUE, stringsAsFactors = FALSE) closeAllConnections() # Create two vectors of variable names, one for odd numbered, # one for even numbered vars1 -

Re: [R] Automatic Recoding

2011-09-02 Thread David Winsemius
On Sep 2, 2011, at 4:14 AM, thomas.chesney wrote: Thank you both for your replies. I've tried it with a small sample of the data and it works perfectly. I have no idea yet how it works but I will spend some time to figure it out. When you get around to putting in the time to figure it

Re: [R] Weights using Survreg

2011-09-02 Thread Boris Beranger
Thank you for your reply, it has been helpful. Do you know if the parameters estimators are MLE estimators? One more question: In my case study I have failures that occured on different objects that have different age and length, could I use weight to find the estimates of a weibull law and so

[R] Bandwith selectors for multivariate local regression

2011-09-02 Thread Soberon Velez, Alexandra Pilar
Dear all, I'm trying to do a multivariate local regression whit the locfit instruction, such as:Y=m(Z,X,W)+u However, I have a problem at the moment of calculte the bandwith of the regression. If I had a univarite local regression model I could use the instruction regband. However,

[R] Standard errors of sexual dimorphism?

2011-09-02 Thread ErikiLund
Hello! I am working on a manuscript on sexual dimorphism in an aquatic invertebrate, where we have estimated sexual dimorphism (SD) for 7 different traits in four populations (a total of 28 SD-estimates). We have used the following formula for estimating SD: 100 * (mean male trait value - mean

Re: [R] merge some columns

2011-09-02 Thread David Winsemius
On Sep 2, 2011, at 8:34 AM, Joao Fadista wrote: Dear all, I would like to know how to merge columns like: Input file: V1 V2 V3 V4 V5 V6 1 G A G G G G 2 A A G A A G Looked like an mapply-type problem: with(dat, mapply(paste, list(V1, V3, V5),

Re: [R] merge some columns

2011-09-02 Thread David Winsemius
On Sep 2, 2011, at 9:30 AM, David Winsemius wrote: On Sep 2, 2011, at 8:34 AM, Joao Fadista wrote: Dear all, I would like to know how to merge columns like: Input file: V1 V2 V3 V4 V5 V6 1 G A G G G G 2 A A G A A G Looked like an mapply-type problem: with(dat,

Re: [R] Maximum Likelihood using optim()

2011-09-02 Thread Sam Stewart
I think the following pdf will explain the details of how to use the optim function. http://www.unc.edu/~monogan/computing/r/MLE_in_R.pdf Hope that helps, Sam On Fri, Sep 2, 2011 at 7:06 AM, Thiem Alrik th...@sipo.gess.ethz.ch wrote: Dear mailing list, I would like to use the optim()

Re: [R] !!!function to do the knn!!!

2011-09-02 Thread jiliguala
really thxs to David Winsemius.. this websits helps a lot, -- View this message in context: http://r.789695.n4.nabble.com/function-to-do-the-knn-tp3781137p3786251.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] post hoc testing of glmer in lme4

2011-09-02 Thread suuz
I have a mixed model with a binomial response, four factor variables and one random factor. m1=glmer(nbhf.hour~Season+Diel+Tidal.phase+Tidal.cycle+(1|POD.ID),family=binomial,data =bl1,control=list(msVerbose=TRUE)) I have really need to try and find a post hoc test for this model and finding the

Re: [R] !!!function to do the knn!!!

2011-09-02 Thread jiliguala
ths a lot, david. it helps a lot -- View this message in context: http://r.789695.n4.nabble.com/function-to-do-the-knn-tp3781137p3786253.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Question about BIC of two different regression models? how should we compare two regression models?

2011-09-02 Thread Patrick Breheny
On 09/02/2011 08:48 AM, John Sorkin wrote: I believe when using BIC one needs to compare nested models This is wrong. Hypothesis tests rely on nested models; information criteria do not. -- Patrick Breheny Assistant Professor Department of Biostatistics Department of Statistics University

Re: [R] If NA Problem!

2011-09-02 Thread Peter Ehlers
On 2011-09-02 05:16, Anna Dunietz wrote: Hi All! Please find code and the respective lists below. My problem: I specify the case that lilwin[[p]] is not an NA and want the code found in iwish to be returned ONLY for that case. Why do I get a list of length 2 (and why is NULL the first

Re: [R] Question about BIC of two different regression models? how should we compare two regression models?

2011-09-02 Thread Prof Brian Ripley
On Fri, 2 Sep 2011, Patrick Breheny wrote: On 09/02/2011 08:48 AM, John Sorkin wrote: I believe when using BIC one needs to compare nested models This is wrong. Hypothesis tests rely on nested models; information criteria do not. Actually, this is off-topic on this list. But blanket

Re: [R] Question about BIC of two different regression models? how should we compare two regression models?

2011-09-02 Thread Bert Gunter
Inline: On Fri, Sep 2, 2011 at 8:09 AM, Patrick Breheny patrick.breh...@uky.edu wrote: On 09/02/2011 08:48 AM, John Sorkin wrote: I believe when using BIC one needs to compare nested models This is wrong.  Hypothesis tests rely on nested models; information criteria do not. Yes, indeed.

[R] Mann Kendall Test for Trend

2011-09-02 Thread ScottM
Hi there, I'm trying to apply the Mann Kendall test for trend analysis of a time series. I have downloaded and installed the package Kendall and subsequently loaded it into the software. My time series is a .txt file with 2 columns - column 1 is the year (1985 - 2009) and column 2 is the

[R] previous monday date

2011-09-02 Thread Ben qant
Hello, I'm attempting to return the date (in form '%Y-%m-%d') of the Monday previous to the current date. For example: since it is 2011-09-02 today, I would expect 2011-08-29 to be the return value. I found the following in: http://www.mail-archive.com/r-help@r-project.org/msg144184.html Start

Re: [R] Advice on large data structures

2011-09-02 Thread Joe Conway
On 09/01/2011 10:13 PM, Worik R wrote: I am starting on a (section of the) project where I need to build a matrix with on the order of 5 million rows and 200 columns I am wondering if I can stay in R. I need to do rollapply type operations on the columns, including some that will be

Re: [R] Question about BIC of two different regression models? how should we compare two regression models?

2011-09-02 Thread Patrick Breheny
On 09/02/2011 11:26 AM, Prof Brian Ripley wrote: This is wrong. Hypothesis tests rely on nested models; information criteria do not. Actually, this is off-topic on this list. But blanket statements are often themselves untrue: there are hypothesis tests of non-nested models (most famously due

Re: [R] Mann Kendall Test for Trend

2011-09-02 Thread R. Michael Weylandt
I don't have the Kendall package at my fingers, but it seems like you have some deeper trouble with R syntax if you are writing things like MannKendall(1:27(data),data) when you know that MannKendall only takes one argument. Can you verify that your data object actually has a full set of data

Re: [R] previous monday date

2011-09-02 Thread Marc Schwartz
On Sep 2, 2011, at 10:35 AM, Ben qant wrote: Hello, I'm attempting to return the date (in form '%Y-%m-%d') of the Monday previous to the current date. For example: since it is 2011-09-02 today, I would expect 2011-08-29 to be the return value. I found the following in:

Re: [R] Mann Kendall Test for Trend

2011-09-02 Thread ScottM
Michael, Cheers for the input - still learning syntax as I go - very new to the use of programming language and having to self teach as part of my PhD. The input data was fine - it was the call on the R website which was confusing me - by defining the location of the actual data in the second

Re: [R] previous monday date

2011-09-02 Thread Ben qant
I didn't sort out the issue in my email below but here is a (not very R'ish) solution: pm = function(x) { + for(i in 1:7){ + if(format(as.Date(Sys.Date()-i),'%w') == 1){ + d = Sys.Date() - i; + } + } + d + } pm(Sys.Date()) [1] 2011-08-29 On Fri, Sep 2, 2011 at 9:35 AM, Ben

Re: [R] previous monday date

2011-09-02 Thread Ben qant
Oh OK, missed that. Here is a solution using base: (already posted) I didn't sort out the issue in my email below but here is a (not very R'ish) solution: pm = function(x) { + for(i in 1:7){ + if(format(as.Date(Sys.Date()- i),'%w') == 1){ + d = Sys.Date() - i; + } + } + d

Re: [R] Mann Kendall Test for Trend

2011-09-02 Thread R. Michael Weylandt
I'd suggest that you look into using a time series class to organize your data rather than just keeping levels and times next to each other. This will also make it alot easier to work with your data in specific time-series sort of ways. I really like the xts class and you can get to it with

Re: [R] previous monday date

2011-09-02 Thread Marc Schwartz
On Fri, Sep 2, 2011 at 9:59 AM, Marc Schwartz marc_schwa...@me.com wrote: On Sep 2, 2011, at 10:35 AM, Ben qant wrote: Hello, I'm attempting to return the date (in form '%Y-%m-%d') of the Monday previous to the current date. For example: since it is 2011-09-02 today, I would expect

[R] Avoiding for Loop for moving average

2011-09-02 Thread Noah Silverman
Hello, I need to calculate a moving average and an exponentially weighted moving average over a fairly large data set (500K rows). Doing this in a for loop works nicely, but is slow. ewma - data$col[1] N - dim(data)[1] for(i in 2:N){ data$ewma - alpha * data$ewma[i-1] + (1-alpha) *

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread R. Michael Weylandt
Have you looked at SMA/EMA from the TTR package? That's a pretty quick implementation. runmean from caTools is even better for the SMA but I don't think there's an easy way to turn that into an EWMA. Hope this helps, Michael Weylandt On Fri, Sep 2, 2011 at 12:43 PM, Noah Silverman

[R] Hints for Data Clustering

2011-09-02 Thread Lorenzo Isella
Dear All, I will be confronted (relatively soon) with the following problem: given a set of known statistical indicators {s_i} , i=1,2...N for a N countries I would like to be able to do some data clustering i.e. determining the best way to partition the N countries according to their known

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Joshua Ulrich
On Fri, Sep 2, 2011 at 11:47 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Have you looked at SMA/EMA from the TTR package? That's a pretty quick implementation. runmean from caTools is even better for the SMA but I don't think there's an easy way to turn that into an EWMA. SMA

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Noah Silverman
Joshua, Thanks for the tip. I need to roll my own code on this. But perhaps I can borrow some code from the package you mentioned. Is the package just performing the loop, but in a faster language? -- Noah Silverman UCLA Department of Statistics 8117 Math Sciences Building #8208 Los

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Abhijit Dasgupta
There is a recent blog post by Dirk Eddelbeutel on how to do something similar using his Rcpp package and C++, with massive time improvements. http://dirk.eddelbuettel.com/blog/ On 9/2/2011 12:43 PM, Noah Silverman wrote: Hello, I need to calculate a moving average and an exponentially

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Joshua Ulrich
On Fri, Sep 2, 2011 at 12:06 PM, Noah Silverman noahsilver...@ucla.edu wrote: Joshua, Thanks for the tip. I need to roll my own code on this.  But perhaps I can borrow some code from the package you mentioned. Is the package just performing the loop, but in a faster language? As I said,

Re: [R] Advice on large data structures

2011-09-02 Thread Alex Ruiz Euler
Along the lines of one of Jim's suggestions, if you have some basic MySQL knowledge check out the RMySQL package. I use it to convert / partition a matrix similar to yours to R objects and it works fine. Hope this helps, A. On Fri, 2 Sep 2011 06:33:13 -0400 Jim Holtman jholt...@gmail.com

Re: [R] Hints for Data Clustering

2011-09-02 Thread Jean V Adams
Look at the function daisy in the package cluster. require(cluster) ?daisy Jean Lorenzo Isella wrote on 09/02/2011 11:50:04 AM: Dear All, I will be confronted (relatively soon) with the following problem: given a set of known statistical indicators {s_i} , i=1,2...N for a N countries I

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Noah Silverman
Thanks Joshua, I really like the example given in the blog post that Abhijit pointed me to. Doing it in C++ using the Inline seems like an easy way to get a massive improvement in speed without the hassle of writing a package. I'm working on coding that now. -- Noah Silverman UCLA Department

Re: [R] Including only a subset of the levels of a factor XXXX

2011-09-02 Thread peter dalgaard
On Sep 1, 2011, at 21:11 , R. Michael Weylandt wrote: Dropping all occurences of a factor does not drop that level. This actually turns out to be much more useful than it first might appear, but if you really need to get around it, it can be done. ...most expediently by using factor(), as

Re: [R] Avoiding for Loop for moving average

2011-09-02 Thread Patrick Burns
The 'filter' function should be able to do what you want efficiently. On 02/09/2011 18:06, Noah Silverman wrote: Joshua, Thanks for the tip. I need to roll my own code on this. But perhaps I can borrow some code from the package you mentioned. Is the package just performing the loop, but

[R] Classifying large text corpora using R

2011-09-02 Thread andy1234
Dear everyone, I am new to R, and I am looking at doing text classification on a huge collection of documents (500,000) which are distributed among 300 classes (so basically, this is my training data). Would someone please be kind enough to let me know about the R packages to use and their

[R] Chemical Names in Data Frames

2011-09-02 Thread Durant, James T. (ATSDR/DTEM/PRMSB)
Greetings - I am working on some data that contain chemical names with air concentrations, and I am creating a data frame with date/time and each chemical having its own column. However, these are organic chemicals (e.g. 1-butene, 2,3,4-trimethylbenzene etc). The package I am going to be using

Re: [R] Chemical Names in Data Frames

2011-09-02 Thread David Winsemius
On Sep 2, 2011, at 3:13 PM, Durant, James T. (ATSDR/DTEM/PRMSB) wrote: Greetings - I am working on some data that contain chemical names with air concentrations, and I am creating a data frame with date/time and each chemical having its own column. However, these are organic chemicals

Re: [R] Chemical Names in Data Frames

2011-09-02 Thread Gustavo Carvalho
?make.names perhaps. On Fri, Sep 2, 2011 at 4:13 PM, Durant, James T. (ATSDR/DTEM/PRMSB) h...@cdc.gov wrote: Greetings - I am working on some data that contain chemical names with air concentrations, and I am creating a data frame with date/time and each chemical having its own column.

Re: [R] Chemical Names in Data Frames

2011-09-02 Thread Spencer Graves
possibly with unique = TRUE: make.names(c(', ')) [1] X. X. make.names(c(', '), unique=TRUE) [1] X. X..1 Spencer On 9/2/2011 12:28 PM, Gustavo Carvalho wrote: ?make.names perhaps. On Fri, Sep 2, 2011 at 4:13 PM, Durant, James T. (ATSDR/DTEM/PRMSB) h...@cdc.gov wrote:

[R] How to keep the same class?

2011-09-02 Thread Eduardo M. A. M.Mendes
Hello Please see the example below class(testX) [1] matrix class(testX[1,]) [1] numeric Why not matrix? What am I missing here? Is there a way to keep the same class? The reason for the question is that I want to implement a k-step ahead prediction for my own routines

Re: [R] How to keep the same class?

2011-09-02 Thread Henrique Dallazuanna
Try this: predict(fit10,testX[1,,drop = FALSE]) On Fri, Sep 2, 2011 at 5:05 PM, Eduardo M. A. M.Mendes emammen...@gmail.com wrote: Hello Please see the example below class(testX) [1] matrix class(testX[1,]) [1] numeric Why not matrix?   What am I missing here?   Is there a way

Re: [R] How to keep the same class?

2011-09-02 Thread Marc Schwartz
On Sep 2, 2011, at 3:05 PM, Eduardo M. A. M.Mendes wrote: Hello Please see the example below class(testX) [1] matrix class(testX[1,]) [1] numeric Why not matrix? What am I missing here? Is there a way to keep the same class? The reason for the

Re: [R] How to keep the same class?

2011-09-02 Thread Eduardo M. A. M.Mendes
Many thanks to all for the reply. I do apologize for bothering the list with a FAQ but I have to confess that, although I read Faq in the past, I did not remember to do it again. Cheers Ed -Original Message- From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: Friday, September

[R] conditional replacement of character strings in vectors

2011-09-02 Thread Josh Tewksbury
Hello, I have a dataframe that looks like this: a b NA Honduras China NA NA Sudan Japan NA NA Mexico NA Mexico I would like to replace the NA values in column b with the non-NA values in column a. I have tried a number of techniques, (if, ifelse) but I must have the logic wrong. Thanks

[R] Hessian Matrix Issue

2011-09-02 Thread tzaihra
Dear All, I am running a simulation to obtain coverage probability of Wald type confidence intervals for my parameter d in a function of two parameters (mu,d). I am optimizing it using optim method L-BFGS-B to obtain MLE. As, I want to invert the Hessian matrix to get Standard errors of the two

[R] Platform of image

2011-09-02 Thread John Welsh
Dear R users, When I Save Workspace... and then reopen it, my platform switches from 64-bit to 32-bit, i.e. the Gui switches between these: R version 2.13.1 (2011-07-08) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0

[R] misclassification rate

2011-09-02 Thread Doussa
Hi users I'm student who is struggling with basic R programming. Would you please help me with this problem. My english is bad I hope that my question is clear: I have a matrix in wich there are two colmns( yp, yt) Yp: predicted values from my model. yt: true values ( my dependante variable y is

[R] Parameters in Gamma Frailty model

2011-09-02 Thread syhuang
Dear all, I'm new to frailty model. I have a question on the output from 'survival' pack. Below is the output. What does gamma1,2,3 refer to? How do I calculate joint hazard function or marginal hazard function using info below? Many thanks! Call: coxph(formula = surv ~ as.factor(tibia) +

Re: [R] conditional replacement of character strings in vectors

2011-09-02 Thread R. Michael Weylandt
Your data frame didn't come across legibly, try sending it in plain text using the dput() command. That said, I'd guess you want something like this: d[is.na(d$a),a] - d[is.na(d$b),b] The idea is that is.na(d$a) selects only those rows where column a is NA and then moves b values into a for

Re: [R] conditional replacement of character strings in vectors

2011-09-02 Thread David Winsemius
On Sep 2, 2011, at 3:51 PM, Josh Tewksbury wrote: Hello, I have a dataframe that looks like this: a b NA Honduras China NA NA Sudan Japan NA NA Mexico NA Mexico I would like to replace the NA values in column b with the non-NA values in column a. I have tried a number of techniques,

[R] ROCR package question for evaluating two regression models

2011-09-02 Thread Andra Isan
Hello All,  I have used logistic regression glm in R and I am evaluating two models both learned with glm but with different predictors. model1 - glm (Y ~ x4+ x5+ x6+ x7, data = dat, family = binomial(link=logit))model2 - glm (Y~ x1 + x2 +x3 , data = dat, family = binomial(link=logit))  and I

Re: [R] Platform of image

2011-09-02 Thread Jeff Newmiller
You don't say how you re-open it, but I would guess you are double-clicking the .RData file and letting Windows look up which program to run. If so, you can either open the 64-bit GUI directly and use File Open Data to open your data, or you can change which version of the R GUI program is

Re: [R] conditional replacement of character strings in vectors

2011-09-02 Thread David Winsemius
On Sep 2, 2011, at 7:51 PM, R. Michael Weylandt wrote: Your data frame didn't come across legibly, try sending it in plain text using the dput() command. That said, I'd guess you want something like this: d[is.na(d$a),a] - d[is.na(d$b),b] One of the rare instances where I disagree with

Re: [R] conditional replacement of character strings in vectors

2011-09-02 Thread R. Michael Weylandt
Y'all are both absolutely right -- I just skimmed the problem and wrote an answer all too briefly that both didn't do what was asked and did what it did instead entirely incorrectly. The syntax suggested by David's email of 7:52 is what I meant to get at... My apologies for any confusion this

[R] confusion matrix

2011-09-02 Thread Doussa
hi users I have a data frame in with there are two colomns real values and predicted ones (for a dichotomic response). How can i obtain a confusion matrix (miscalssification rat and errors)? The costs are egal. Thanks -- View this message in context:

[R] problem in applying function in data subset (with a level) - using plyr or other alternative are also welcome

2011-09-02 Thread Maya Joshi
Dear R experts. I might be missing something obvious. I have been trying to fix this problem for some weeks. Please help. #data ped - c(rep(1, 4), rep(2, 3), rep(3, 3)) y - rnorm(10, 8, 2) # variable set 1 M1a - sample (c(1, 2,3), 10, replace= T) M1b - sample (c(1, 2,3), 10, replace= T) M1aP1 -

Re: [R] problem in applying function in data subset (with a level) - using plyr or other alternative are also welcome

2011-09-02 Thread David Winsemius
On Sep 2, 2011, at 11:18 PM, Maya Joshi wrote: Dear R experts. I might be missing something obvious. I have been trying to fix this problem for some weeks. Please help. #data ped - c(rep(1, 4), rep(2, 3), rep(3, 3)) y - rnorm(10, 8, 2) # variable set 1 M1a - sample (c(1, 2,3), 10,

Re: [R] Platform of image

2011-09-02 Thread Prof Brian Ripley
On Fri, 2 Sep 2011, Jeff Newmiller wrote: You don't say how you re-open it, but I would guess you are double-clicking the .RData file and letting Windows look up which program to run. If so, you can either open the 64-bit GUI directly and use File Open Data to open your data, or you can