Re: [R] Circular variables within a GLM, GLM-GEE or GAM

2011-01-21 Thread Clare Embling
Hi Simon, Thanks for that! Yes the circular variable is a predictor variable - great that it can be done using GAMs. I actually would like to do a GAM-GEE model - do you know if I can do this within R yet? I'm using GLM-GEEs because I can't do GAM-GEEs (I have data collected over the same

Re: [R] data and parameters

2011-01-21 Thread Moritz Grenke
#dummy data: master=as.data.frame(list(clientId=c(1:4,2), date=1001:1005, value=10001:10005)) control=as.data.frame(list(clientId=c(2,3), mindate=c(100,1005), maxdate=c(1005,1005), control.params=c(1,2))) #reducing master df: #generating TRUE FALSE index: idIndex=master$clientId %in%

[R] forecasting with L-STAR

2011-01-21 Thread Sara Szeremeta
Is it possible to make forecasts with L-STAR model (or alternatively E-STAR) ? Although function for LSTAR exists I did not find an indication of forecasting possibilities in the documentation. [[alternative HTML version deleted]] __

[R] 3D Binning

2011-01-21 Thread vioravis
I am trying to do binning on three variables (3d binning). The bin boundaries are specified by the user separately for each variable. I used the bin2 function in the 'ash' package for 2d binning that involves only two variables but didn't any package for similar binning with three variables. Are

[R] help! complete the reviewer's suggest: carry out GA+GP (gaussian process)!

2011-01-21 Thread bbslover
Hello, all experts, My major is computer-aied drug design ( main QSAR). Now, my paper need be reviesed, and one reviewer ask me do genetic algorithm coupled with gaussian process method (GA+GP). my data: training set: 191*106 test set: 73*106 here, I need use GA+GP to do variable

[R] nlminb doesn't converge and produce a warning

2011-01-21 Thread kamel gaanoun
Hi Everybody, My problem is that nlminb doesn't converge, in minimising a logLikelihood function, with 31*6 parameters(2 weibull parameters+29 regressors repeated 6 times). I use nlminb like this : res1-nlminb(vect, V, lower=c(rep(0.01, 12), rep(0.01, 3), rep(-Inf, n-15)), upper=c(rep(Inf, 12),

[R] Loop and store results

2011-01-21 Thread Sam
Dear List, I have a data-frame #prepare the data example - data.frame(letters[1:9], sample(letters, 9), sample(letters, 9), sample(letters, 9), sample(letters, 9), sample(letters, 9), sample(letters, 9), sample(letters, 9), sample(letters,

Re: [R] auc function

2011-01-21 Thread Petr Savicky
On Thu, Jan 20, 2011 at 03:14:01PM -0800, Changbin Du wrote: ROCR I appreciate this information, which is new for me. Up to now, i was using the function get.auc - function(statistic, label, negative, positive) { xmove - as.numeric(label == negative) ymove - as.numeric(label

[R] stochastic models for population growth

2011-01-21 Thread Vassily Shvets
Hello, Having measured two populations' characteristics at one particular time[with great precision] with R, I would like to extend this to measuring the same populations starting at t1, and then again at t2, and try to develop a growth model (something like

Re: [R] Loop and store results

2011-01-21 Thread Henrique Dallazuanna
Try this: replicate(500, example[sample(nrow(example), 3),], simplify = FALSE) On Fri, Jan 21, 2011 at 8:47 AM, Sam sam_sm...@me.com wrote: Dear List, I have a data-frame #prepare the data example - data.frame(letters[1:9], sample(letters, 9), sample(letters, 9),

[R] Function comparable to cutpt.coxph from Survival Analysis using S

2011-01-21 Thread Schneider, Friederike Dr.
Dear Mrs Rachel Pearce, I am looking for a function cutpt-coxph in R - like you did some years ago. How have you solved the problem? Have you found it or a similar function? thank you, Sincerely, Friederike The title says it all really; I am looking for a function along the lines of cutpt.coxph

Re: [R] nlminb doesn't converge and produce a warning

2011-01-21 Thread Karl Ove Hufthammer
kamel gaanoun wrote: I use nlminb like this : res1-nlminb(vect, V, lower=c(rep(0.01, 12), rep(0.01, 3), rep(-Inf, n-15)), upper=c(rep(Inf, 12), rep(0.99, 3), rep(Inf, n-15)), control = list(maxit=1000) ) and that's the result : Message d'avis : In nlminb(vect, V, lower = c(rep(0.01,

[R] User input in R program

2011-01-21 Thread christiaan pauw
HI Everybody Does anyone know of documentation about different ways of obtaining user input in R. I have used readline() but I wondered is there are sophisticated packages that does things like validate answers or generate selection lists. bets regards Christaan [[alternative HTML

[R] How to look into the asterisked function?

2011-01-21 Thread Bogaso Christofer
Hi friends, there is methods() function to see the all available methods for a particular function, for example: head(methods(print)) [1] print.acf print.anova print.aov print.aovlist print.ar print.Arima In this list, there are some functions which are asterisked like

Re: [R] How to look into the asterisked function?

2011-01-21 Thread Henrique Dallazuanna
Try this: getS3method(print, acf) On Fri, Jan 21, 2011 at 11:02 AM, Bogaso Christofer bogaso.christo...@gmail.com wrote: Hi friends, there is methods() function to see the all available methods for a particular function, for example: head(methods(print)) [1] print.acf print.anova

Re: [R] How to look into the asterisked function?

2011-01-21 Thread jim holtman
You can also use: getAnywhere(functionName) On Fri, Jan 21, 2011 at 8:02 AM, Bogaso Christofer bogaso.christo...@gmail.com wrote: Hi friends, there is methods() function to see the all available methods for a particular function, for example: head(methods(print)) [1] print.acf    

Re: [R] data and parameters

2011-01-21 Thread jim holtman
try 'sqldf' master=as.data.frame(list(clientId=c(1:4,2), date=1001:1005, + value=10001:10005)) control=as.data.frame(list(clientId=c(2,3), mindate=c(100,1005), + maxdate=c(1005,1005), control.params=c(1,2))) master clientId date value 11 1001 10001 22 1002 10002 33

Re: [R] data and parameters

2011-01-21 Thread jim holtman
forgot the control parameters: sqldf( + select m.*, c.control_params + from master m, control c + where m.clientId = c.clientID + and m.date between c.mindate and c.maxdate + ) clientId date value control_params 12 1002 10002 1 2

Re: [R] Extraction and replacement of data in a data frame

2011-01-21 Thread michael.hopgood
Dear all, Thank you for the prompt responses. It is until today that I have managed to scrap together the time to develop my R-project further. In my free time, I have been reading various intro manuals, so I have a rough idea of what needs doing. Sometimes, though, putting it into practice

Re: [R] User input in R program

2011-01-21 Thread Hugo Mildenberger
Hello Christian, for an example of interacting with graphic output, just run example(getGraphicsEvent) However, on X11, that feature had ceased to work since a pre-release of R-2.12 if Cairo support was enabled at compile time. The reason for this defect had already been documented in R's

[R] complex transformation of data

2011-01-21 Thread Den
Dear [R] people Could you please help with following data transformation. Any suggestions, hints, references and even guessing on performing any of the following steps are highly appreciated. Those transformations are crucial for my work. (n_, _n, j_, k_ signify numbers) SOURCE DATA: id

Re: [R] Function comparable to cutpt.coxph from Survival Analysis using S

2011-01-21 Thread Frank Harrell
It is very uncommon for the assumptions underlying this method to be satisfied. These assumptions include (1) the relationship between X and log relative hazard is discontinuous at X=c and only X=c; (2) c is correctly found as the cutpoint; (3) X vs log hazard is flat to the left of c; (4) X vs

Re: [R] Regression Testing

2011-01-21 Thread Mojo
On 1/20/2011 4:42 PM, Achim Zeileis wrote: On Thu, 20 Jan 2011, Mojo wrote: I'm new to R and some what new to the world of stats. I got frustrated with excel and found R. Enough of that already. I'm trying to test and correct for Heteroskedasticity I have data in a csv file that I load

Re: [R] Regression Testing

2011-01-21 Thread Achim Zeileis
On Fri, 21 Jan 2011, Mojo wrote: On 1/20/2011 4:42 PM, Achim Zeileis wrote: On Thu, 20 Jan 2011, Mojo wrote: I'm new to R and some what new to the world of stats. I got frustrated with excel and found R. Enough of that already. I'm trying to test and correct for Heteroskedasticity I

Re: [R] User input in R program

2011-01-21 Thread Matt Shotwell
Martyn Plummer's 'coda' package has some nice interactive menus. The package appears to be written entirely in R. You could start with the codamenu() function in the package source: http://cran.r-project.org/web/packages/coda/index.html -Matt On Fri, 2011-01-21 at 14:26 +0200, christiaan pauw

Re: [R] User input in R program

2011-01-21 Thread D Kelly O'Day
Christian Have you looked at the http://www.stats.gla.ac.uk/~adrian/rpanel/ rpanel package? I have a post which shows an example of interactive input that allows user to adjust plot parameters. http://chartsgraphs.wordpress.com/2009/05/08/rpanel-package-adds-interactive-capabilites-to-r/

Re: [R] complex transformation of data

2011-01-21 Thread ONKELINX, Thierry
Denis, Have a look at paste(), aggregate(), ddply() (from the plyr package) and melt() and cast() (both from the reshape package). Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek

Re: [R] complex transformation of data

2011-01-21 Thread Moritz Grenke
Hi Denis, #minimal example: test-as.data.frame(list(id=c(1,1,1,2,2,2), cycle1=c(c, m, f, m, f, c))) #gettin your first cell of Result 1 paste(sort(test$cycle1[test$id==1]), collapse=) Hope this helps for the first task ... Moritz __ Moritz Grenke http://www.360mix.de

Re: [R] User input in R program

2011-01-21 Thread Mauricio Zambrano
Probably, iplots may be useful for you: http://cran.r-project.org/web/packages/iplots/index.html Kinds, Mauricio -- === Linux user #454569 -- Ubuntu user #17469 === 2011/1/21 christiaan pauw cjp...@gmail.com: HI Everybody Does anyone

[R] HHT-methodology

2011-01-21 Thread Torbjørn Lorentzen
Hello R-experts, I wonder whether any of the R-packages cover the Hilbert-Huang Transform methodology (HHT)? Regards, Torbjorn -- Torbjørn Lorentzen | torbjorn.lorent...@bjerknes.uib.no |torbjorn.lorent...@uni.no | http://www.bjerknes.uib.no/ Phone: +47 55 58 25 05 | Cellphone: +47 906

[R] Error in ANOVA for model comparison

2011-01-21 Thread Rosario Garcia Gil
Hello I am trying to compare two models using anova(), however I get a message error (see below). In the net I only found some information on certain library(car) for which one should use anova with A capital letter (Anova instead of anova), but I could not find car library as it says it does

[R] Help for lattice. par(new=TRUE)

2011-01-21 Thread Fabrice Tourre
Hi list, I want to plot two plot in the same figure. I set par(new=TRUE). But it does not work. library(lattice) myPanel - function(x,...) { panel.histogram(x,alpha=0.4,...) ltext(0.4,1.5,paste(Mean=,0.05,digit=2)),cex=0.8) ltext(0.8,1.5,paste(s.d.=,0.06,digit=2)),cex=0.8) }

Re: [R] Regression Testing

2011-01-21 Thread Mojo
On 1/21/2011 9:13 AM, Achim Zeileis wrote: On Fri, 21 Jan 2011, Mojo wrote: On 1/20/2011 4:42 PM, Achim Zeileis wrote: On Thu, 20 Jan 2011, Mojo wrote: I'm new to R and some what new to the world of stats. I got frustrated with excel and found R. Enough of that already. I'm trying to

Re: [R] Regression Testing

2011-01-21 Thread Achim Zeileis
On Fri, 21 Jan 2011, Mojo wrote: On 1/21/2011 9:13 AM, Achim Zeileis wrote: On Fri, 21 Jan 2011, Mojo wrote: On 1/20/2011 4:42 PM, Achim Zeileis wrote: On Thu, 20 Jan 2011, Mojo wrote: I'm new to R and some what new to the world of stats. I got frustrated with excel and found R. Enough

Re: [R] How to look into the asterisked function?

2011-01-21 Thread Bogaso Christofer
Thanks Jim and Henrique for your replies. I would like to know why some particular functions are asterisked? What is the pros and cons while making a typical UDF asterisked? How can I make a typical function asterisked? For example print.anova() is not asterisked however print.acf() is. How can I

Re: [R] Error in ANOVA for model comparison

2011-01-21 Thread John Fox
Dear Rosario, Because of missing data in the additional variable PHt, the two models weren't fit to the same subset of valid observations -- the default in lm() is to use complete cases for the variables in the model. A mechanical solution is to use na.omit() to filter your data set, only for

[R] clustering fuzzy

2011-01-21 Thread pete
hello, i'm pete ,how can i order rows of matrix by max to min value? I have a matrix of membership degrees, with 82 (i) rows and K coloumns, K are clusters. I need first and second largest elements of the i-th row. for example 1 0.66 0.04 0.01 0.30 2 0.02 0.89 0.09 0.00 3 0.06 0.92 0.01 0.01

Re: [R] complex transformation of data

2011-01-21 Thread Henrique Dallazuanna
Try this: aggregate(.~ id, lapply(test, as.character), FUN = paste, collapse = ) On Fri, Jan 21, 2011 at 10:25 AM, Den d.kazakiew...@gmail.com wrote: Dear [R] people Could you please help with following data transformation. Any suggestions, hints, references and even guessing on performing

Re: [R] clustering fuzzy

2011-01-21 Thread jim holtman
use 'apply': head(x.m) V2 V3 V4 V5 [1,] 0.66 0.04 0.01 0.30 [2,] 0.02 0.89 0.09 0.00 [3,] 0.06 0.92 0.01 0.01 [4,] 0.07 0.71 0.21 0.01 [5,] 0.10 0.85 0.04 0.01 [6,] 0.91 0.04 0.02 0.02 x.m.sort - apply(x.m, 1, sort, decreasing = TRUE) head(t(x.m.sort)) [,1] [,2] [,3] [,4]

[R] Maxiter specification in R

2011-01-21 Thread Hongwei Dong
Dear R users, I'm having a problem with maxiter specification in VGLM function. I tried to increase the number of iteration to 100, but it still stopped at 30, which is the default. Here is my script: FIT - vglm(SFH_PCT ~ RD_DEN + CAR_HH + TRS + RES_L, tobit(Lower=0), maxiter = 100) Thanks

Re: [R] Maxiter specification in R

2011-01-21 Thread David Winsemius
On Jan 21, 2011, at 12:34 PM, Hongwei Dong wrote: Dear R users, I'm having a problem with maxiter specification in VGLM function. I tried to increase the number of iteration to 100, but it still stopped at 30, which is the default. Here is my script: FIT - vglm(SFH_PCT ~ RD_DEN + CAR_HH

Re: [R] number of iterations in a Tobit model

2011-01-21 Thread Terry Therneau
-- begin inclusion --- I'm running a Tobit model but convergence can not be reached within 30 iterations. Is there anyway I can change the max number of iterations? Thanks. --- end inclusion --- Tobit is simply a linear model with censored data. You don't say how you are fitting this, but I'll

Re: [R] randomForest: too many elements specified?

2011-01-21 Thread Liaw, Andy
I grep for n, n) in all the R code of the package (current version), and the only place that happens is in creating proximity. Can you do a traceback() and see where it happens? You should seriously consider upgrading R and the packages... Andy -Original Message- From:

Re: [R] nlminb doesn't converge and produce a warning

2011-01-21 Thread Douglas Bates
On Fri, Jan 21, 2011 at 3:51 AM, kamel gaanoun kamel.gaan...@gmail.com wrote: Hi Everybody, My problem is that nlminb doesn't converge, in minimising a logLikelihood function, with 31*6 parameters(2 weibull parameters+29 regressors repeated 6 times). Hmm, the length of the parameter vector

Re: [R] nlminb doesn't converge and produce a warning

2011-01-21 Thread Ravi Varadhan
Hi, It is indeed annoying that each optimization code has different names for the parameters that control the behavior of the algorithms. This is one of the reasons that we have developed optimx - to unify the calling convention for the various algorithms. You can call the optimization

Re: [R] Unexpected Gap in simple line plot

2011-01-21 Thread Duncan Murdoch
On 20/01/2011 9:33 PM, D Kelly O'Day wrote: Bill Duncan Thanks for your quick reply. I would still be looking for days. Now I have to figure out how the bad data got into cts since I generate this file each month. When I read that .csv file in OpenOffice, the lines with the NAs arise

[R] Marginality rule between powers and interaction terms in lm()

2011-01-21 Thread JiHO
Dear all, I have a model with simple terms, quadratic effects, and interactions. I am wondering what to do when a variable is involved in a significant interaction and in a non-significant quadratic effect. Here is an example d = data.frame(a=runif(20), b=runif(20)) d$y = d$a +

[R] extracting random intercept

2011-01-21 Thread Xebar Saram
Hi all I am using this model for a time series analysis : lung_new - (glmmPQL(LUNG ~ 1, random = ~ 1 | GUID, family = poisson, data = ts0004lag) Im interested in extracting just the random intercept can anyone point me in the right direction thx zeltak [[alternative HTML version

[R] Extracting random intercept

2011-01-21 Thread Xebar Saram
Hi all I am using this model for a time series analysis : lung_new - (glmmPQL(LUNG ~ 1, random = ~ 1 | GUID, family = poisson, data = ts0004lag) Im interested in extracting just the random intercept can anyone point me in the right direction thx zeltak

Re: [R] Inconsisten graphics i/o when using Rscript versus GUI

2011-01-21 Thread MacQueen, Don
John, The first thing I would do is create a simpler example, i.e., to help isolate the issue. Here’s a simple example: The contents of a file are: #! /usr/bin/Rscript pdf('test1.pdf') plot(1:10) dev.off() pdf('test2.pdf') plot(10:1) dev.off()

Re: [R] complex transformation of data

2011-01-21 Thread Henrique Dallazuanna
Try this: aggregate(.~ id, lapply(replace(df, is.na(df), ''), as.character), FUN = paste, collapse = , na.action = na.pass) On Fri, Jan 21, 2011 at 5:45 PM, Den d.kazakiew...@gmail.com wrote: Dear Henrique Thank you again for helping me Unfortunately, your code seems not to be working

Re: [R] complex transformation of data

2011-01-21 Thread Henrique Dallazuanna
correction: aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = , na.action = na.pass) On Fri, Jan 21, 2011 at 5:56 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this: aggregate(.~ id, lapply(replace(df, is.na(df), ''), as.character), FUN = paste, collapse = , na.action

Re: [R] complex transformation of data

2011-01-21 Thread Den
Dear Henrique Thank you again for helping me Unfortunately, your code seems not to be working aggregate(.~ id, lapply(df, as.character), FUN = paste, collapse = ) id cycle1 cycle2 cycle3 1 1cmfcmfcmf 2 2mfcmfcmfc 3 3 cf cf cf (letter 'a' missing in

[R] Information

2011-01-21 Thread Akash
Hello I am student of Bioinformatics and I am doin somework in R in which some problem occurs. So Please help me to solve these problems. I have two problems: 1. How to generate a graph in which there are 8 rows and 20 columns are present? 2. And how to put some title in the end of the graph i.e

[R] Looping with incremented object name and increment function

2011-01-21 Thread Michael Costello
Folks, I am trying to get a loop to run which increments the object name as part of the loop. Here fit1 fit2 fit3 and fit4 are linear regression models that I have created. for (ii in c(1:4)){ + SSE[ii]=rbind(anova(fit[ii])$Sum Sq) + dfe[ii]=rbind(summary(fit[ii])$df) + } Error in

[R] Storm Clustering using clusters in evd

2011-01-21 Thread dpender
Hi, I am using the clusters function in the evd package in order to determine storm events from a wave time series. So far I have the code working as I want it for wave height on its own but I would now like to include the period as well. The input data is in the form of: H t H t H t so

[R] confidence interval

2011-01-21 Thread Francesco Petrogalli
Hi, I have a circular shaped set of point on the plane (X,Y) centered in zero. The distribution is more dense close to zero and less dense far from zero. I need to find the radius of a circle centered in zero that contains 65% of the points in the sample. Is there any R directive that can do

[R] How to find data that includes certain values

2011-01-21 Thread poppinkid
I am trying to return an index for a data set by searching using filenames. The name may be ANG_AUT.N.0734C70411A-1_1sA_0734C70411A.fasta, but i'd just like to search it using the term 0734C70411 as the file may be 0734C70411A or 0734C70411C or 0734C70411D Any way to do this other than doing

Re: [R] clustering fuzzy

2011-01-21 Thread pete
thank you ,you have been very kind -- View this message in context: http://r.789695.n4.nabble.com/clustering-fuzzy-tp3229853p3230228.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] User input in R program

2011-01-21 Thread jverzani
christiaan pauw cjpauw at gmail.com writes: HI Everybody Does anyone know of documentation about different ways of obtaining user input in R. I have used readline() but I wondered is there are sophisticated packages that does things like validate answers or generate selection lists. You

[R] ordering a vector

2011-01-21 Thread Francesco Petrogalli
Hi, is there a R function that order a matrix according to some criteria based on the rows(or cols) of that matrix? For example, let's say that my matrix S is composed by n rows S_1, S_2,.., S_n and that I compute some real value g_i=g(S_i) for each row. Then I want to order this set of g_i (from

Re: [R] How to find data that includes certain values

2011-01-21 Thread jim holtman
There are several pattern matching functions that will solve your problem: grep regexpr do RSiteSearch(pattern match) On Fri, Jan 21, 2011 at 12:26 PM, poppinkid j...@bcm.edu wrote: I am trying to return an index for a data set by searching using filenames. The name may be

Re: [R] How to find data that includes certain values

2011-01-21 Thread Henrique Dallazuanna
Take a look on grep function. On Fri, Jan 21, 2011 at 3:26 PM, poppinkid j...@bcm.edu wrote: I am trying to return an index for a data set by searching using filenames. The name may be ANG_AUT.N.0734C70411A-1_1sA_0734C70411A.fasta, but i'd just like to search it using the term 0734C70411

Re: [R] complex transformation of data

2011-01-21 Thread Henrique Dallazuanna
Just change the FUN function: aggregate(.~ id, lapply(df, as.character), FUN = function(x)paste(sort(x), collapse = ''), na.action = na.pass) On Fri, Jan 21, 2011 at 6:27 PM, Den d.kazakiew...@gmail.com wrote: Thank you for your efforts. Although it is still not working, it feels like

Re: [R] ordering a vector

2011-01-21 Thread jim holtman
look at 'order' yourMatrix[order(yourMatrix[, 'yourCol']), ] On Fri, Jan 21, 2011 at 2:38 PM, Francesco Petrogalli francesco.petroga...@gmail.com wrote: Hi, is there a R function that order a matrix according to some criteria based on the rows(or cols) of that matrix? For example, let's say

Re: [R] ordering a vector

2011-01-21 Thread Peter Langfelder
I think you want the following, assuming you defined your function g(): gValues = apply(S, 1, g); Sordered = S[order(gValues), ] Peter On Fri, Jan 21, 2011 at 11:38 AM, Francesco Petrogalli francesco.petroga...@gmail.com wrote: Hi, is there a R function that order a matrix according to some

Re: [R] Pearson correlation with randomization

2011-01-21 Thread David Winsemius
On Jan 21, 2011, at 3:29 PM, Brahmachary, Manisha wrote: Hi David, Thanks a lot for you inputs. I have modified my code accordingly. There is one more place that I need some help. This is my code: = = == == X-

Re: [R] Information

2011-01-21 Thread David Winsemius
On Jan 21, 2011, at 2:59 PM, Akash wrote: Hello I am student of Bioinformatics and I am doin somework in R in which some problem occurs. So Please help me to solve these problems. I have two problems: 1. How to generate a graph in which there are 8 rows and 20 columns are present? 2.

Re: [R] confidence interval

2011-01-21 Thread David Winsemius
On Jan 21, 2011, at 11:33 AM, Francesco Petrogalli wrote: Hi, I have a circular shaped set of point on the plane (X,Y) centered in zero. The distribution is more dense close to zero and less dense far from zero. I need to find the radius of a circle centered in zero that contains 65% of the

Re: [R] Looping with incremented object name and increment function

2011-01-21 Thread Greg Snow
This is FAQ 7.21. The real gem in the answer there is at the end where it tells you that it is easier to just use a list. If your fit1, fit2, fit3, and fit4 were elements in a list then you can just loop through the list elements, or even easier use the lapply function to loop through the

[R] Help with LMSreg

2011-01-21 Thread eniven
I'm doing regression with least median squares (LMS) using the lmsreg command. I've got the coefficients (slope and intercept), but how do I get the LMS correlation coefficient? Thanks, in advance, for any help! -- View this message in context:

Re: [R] complex transformation of data

2011-01-21 Thread Den
Thank you for your efforts. Although it is still not working, it feels like getting closer and closer. id cycle1 cycle2 cycle3 1 1cmfcmfcmf 2 2mfcmfcmfc 3 3 acfNA acfNA NAcfm I really appreciate transformation from subsets (c,m,f) to cmf. That was critical for

[R] building package

2011-01-21 Thread las65
I have built a package that I would like to submit to the CRAN. When I perform a R CMD check I get the following warning: * checking Rd cross-references ... WARNING Error in .find.package(package, lib.loc) : there is no package called 'foreign' Calls: Anonymous - lapply - FUN - .find.package

Re: [R] Pearson correlation with randomization

2011-01-21 Thread Brahmachary, Manisha
Hi David, Thanks a lot for you inputs. I have modified my code accordingly. There is one more place that I need some help. This is my code: == X- read.table(X.txt,as.is=T,header=T,row.names=1) Y-

[R] TRADUCING lmer() syntax into lme()

2011-01-21 Thread Freddy Gamma
-- Forwarded message -- From: Freddy Gamma freddy.ga...@gmail.com Date: 2011/1/21 Subject: TRADUCING lmer() syntax into lme() To: r-sig-mixed-mod...@r-project.org Dear Rsociety, I'd like to kingly ask to anyone is willing to answer me how to implement a NON NESTED random effects

[R] glitch in building R package

2011-01-21 Thread Horace Tso
I follow Alan Lenarcic's very helpful tutorial on building R package for Windows (XP), which could be found in www.stat.columbia.edu/~gelman/stuff_for_blog/AlanRPackageTutorial.pdfhttp://www.stat.columbia.edu/~gelman/stuff_for_blog/AlanRPackageTutorial.pdf. The package involves a small dll

Re: [R] building package

2011-01-21 Thread Duncan Murdoch
On 11-01-21 3:33 PM, la...@buffalo.edu wrote: I have built a package that I would like to submit to the CRAN. When I perform a R CMD check I get the following warning: * checking Rd cross-references ... WARNING Error in .find.package(package, lib.loc) : there is no package called 'foreign'

Re: [R] How to find data that includes certain values

2011-01-21 Thread Den
Hello Consider following dataframe named df var1var2var3 3771354 565 654654 963 6677 775 147 657754 df - read.table('clipboard', header = TRUE) df #find indexes with '77' in var 1 myIndexes - grep( glob2rx(*77*), df$var1) myIndexes #find actual values of seach above

Re: [R] complex transformation of data

2011-01-21 Thread Den
That great! It's working! Thank you so much! It is a pure magic which makes my head spin. aggregate(.~ id, lapply(df, as.character), FUN = function(x)paste(sort(x), collapse = ''), na.action = na.pass) 1. help says: Note that ‘paste()’ coerces ‘NA_character_’, the character missing value, to

[R] lm(y ~ x1) vs. lm(y ~ x0 + x1 - 1) with x0 - rep(1, length(y))

2011-01-21 Thread jochen laubrock
Dear list, the following came up in an introductory class. Please help me understand the -1 (or 0+) syntax in formulae: Why do the enumerator dfs, F-statisics etc. differ between the models lm(y ~ x1) and lm(y ~ x0 + x1 - 1), if x0 is a vector containing simply ones? Example: N - 40 x0 -

Re: [R] Looping with incremented object name and increment function

2011-01-21 Thread Dennis Murphy
Hi: Here's an example of how to extract pieces from model objects using the plyr package. I'm using the attitude data set from the datasets package (autoloaded). # Generate four models m1 - lm(rating ~ ., data = attitude) m2 - lm(rating ~ complaints + learning, data = attitude) m3 - lm(rating ~

Re: [R] lm(y ~ x1) vs. lm(y ~ x0 + x1 - 1) with x0 - rep(1, length(y))

2011-01-21 Thread David Winsemius
On Jan 21, 2011, at 9:03 PM, jochen laubrock wrote: Dear list, the following came up in an introductory class. Please help me understand the -1 (or 0+) syntax in formulae: Why do the enumerator dfs, F-statisics etc. differ between the models lm(y ~ x1) and lm(y ~ x0 + x1 - 1), if x0 is

[R] R - Vectorization and Functional Programming Constructs

2011-01-21 Thread Mingo
Hello, I am new to R (coming from Perl) and have what is, at least at this point, a philosophical question and a request for comment on some basic code. As I understand it - R emphasizes ,or at least supports, the functional programming model. I've come across some code that was markedly absent in

Re: [R] lm(y ~ x1) vs. lm(y ~ x0 + x1 - 1) with x0 - rep(1, length(y))

2011-01-21 Thread Bert Gunter
Well ... as x1 is continuous(numeric), it has no levels. So ...?? Note that the fits are identical for both models. The issue is only what is the Null that you are testing in the two cases. In the first case, it is just y = constant, so you are testing the 1 df for x1. In the second, it is y = 0

Re: [R] lm(y ~ x1) vs. lm(y ~ x0 + x1 - 1) with x0 - rep(1, length(y))

2011-01-21 Thread jochen laubrock
Thank you all (including Dennis), this was elucidating. I would have (maybe naively) anticipated that in this somewhat pathological case of fitting without an intercept and re-introducing it via constant x1, R might check whether the design matrix includes a column of ones, and adjust the

[R] about matrices merge and retrieve algorithm.

2011-01-21 Thread pratik wankhade
I have a problem as follows: 1. If we have 3 matrices A,B,C and we merge them in a single matrix ABC by any method like addition , subtraction division,multiplication,etc 2. and then we want to retrieve original 3 matrices A,B,C from single ABC matrix What will be the algorithm?

[R] Debian ?Ubuntu version of latest R using synaptic in Ubuntu 10.10

2011-01-21 Thread Ajay Ohri
Dear List I use synaptic to download R on my Ubuntu 10.10. It seems latest version of R on Ubuntu is 2.11.1 Even when I use debian.cran.r-project.org to update my packages the problem remains (latest versions on CRAN are almost always 2 updates ahead of Debian packages) This is also true for a

Re: [R] Accessing MySQL Database in R

2011-01-21 Thread Sascha Vieweg
I think this is not an R issue, but one of MAMP. On my server's sql service, I can connect using password, however, on my local MAMP, I need the socket: dbCon - dbConnect(dbdr, user=root, password=root, dbname=mydb, unix.socket=/Applications/MAMP/tmp/mysql/mysql.sock) HTH, *S* On