[R] Plotting problem [lars()/elasticnet()]

2009-07-12 Thread spime
Dear all, I am using modified LARS algorithm (ref: The Adaptive Lasso and Its Oracle Properties, Zou 2006) for adaptive lasso penalized linear regression. 1. w(j) - |beta_ols(j)|^(-gamma) gamma0 and j = 1,...,p 2. define x_new(j) - x(j)*w(j) 3. apply LARS to solve modified lasso

[R] Specifying a more complex covariance matrix in lme or lmer

2009-07-12 Thread Chun (Jimmie) Ye
Hi all, I've searched threads and read up on some ways of doing this but I'm having a hard time to get it to work. Here's my basic problem. I have the following linear mixed model y = Xb+Zu+e where u~N(0,s^2*K) where K is a matrix. I read a thread that basically suggested to decompose Zu into

[R] Nonlinear Least Squares nls() programming help

2009-07-12 Thread MathZero
Hi, I am trying to use the nls() function to closely approximate a vector of values, colC and I'm running into trouble. I am not sure how if I am asking the program to do what I think its doing, because the same minimization in Excel's Solver does not run into problems. If anyone can tell me

Re: [R] Reading data entered within an R program

2009-07-12 Thread Sam Thomas
threeftmetered Sent from my Windows Mobile® phone. -Original Message- From: Muenchen, Robert A (Bob) muenc...@utk.edu Sent: Saturday, July 11, 2009 4:43 PM To: R-help@r-project.org R-help@r-project.org Subject: [R] Reading data entered within an R program Dear R-helpers, I know of two

Re: [R] ggplot2: geom_errorbarh()

2009-07-12 Thread hadley wickham
Hi Benoit, What do you expect width to do? You are already setting the left and right extents with xmin and xmax. Hadley On Thu, Jul 9, 2009 at 10:37 AM, Benoit Boulinguiezbenoit.boulingu...@ensc-rennes.fr wrote: Hi all, quick question: is the optional command width effective in the

Re: [R] curve from a formula with ggplot2

2009-07-12 Thread hadley wickham
Hi Benoit, Have a look at http://had.co.nz/ggplot2/stat_function.html. Does that help? Hadley On Tue, Jul 7, 2009 at 11:15 AM, Benoit Boulinguiezbenoit.boulingu...@ensc-rennes.fr wrote: Hi all, I'm smoothly transferring my lattice graphs to ggplot2 graphs, but I'm stuck on representing a

Re: [R] R-help Digest, Vol 77, Issue 13

2009-07-12 Thread Neotropical bat risk assessments
Hi all, Where can I find detail of use of seewave? Seems no help included in the package using ??seewave does not provide anything. Tnx __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] getting a timeseries element into a string

2009-07-12 Thread tradenet
I added a reproducible example to my question... ts-dummyDailySeries(x = rnorm(365), units = NULL, zone = , FinCenter = ) (ts[1,0]) #returns first date in return series GMT 1970-01-01 ttt-(sprintf(%s,ts[1,0])) print(ttt) character(0) ttt-(ts[1,0]) print(ttt) GMT 1970-01-01 what I

Re: [R] Heckman Selection Model/Inverse Mills Ratio

2009-07-12 Thread Achim Zeileis
On Sat, 11 Jul 2009, saurav pathak wrote: I have so far used the following command glm(formula = s ~ age + gender + gemedu + gemhinc + es_gdppc + imf_pop + estbbo_m, family = binomial(link = probit)) My question is 1. How do i discard the non significant selection variables (one out of the

Re: [R] Stratified data summaries

2009-07-12 Thread David Winsemius
On Jul 9, 2009, at 6:52 PM, Hayes, Rachel M wrote: I'm trying to automate a data summary using summary or describe from the HMisc package. I want to stratify my data set by patient_type. I was hoping to do something like: Describe(myDataFrame ~ patient_type) by(myDataFrame,

Re: [R] Stratified data summaries

2009-07-12 Thread David Freedman
You might also want to look at the doBy package - one function is summaryBy: summaryBY(var1 + var2 ~ patient_type, data=d, FUN=summary) david freedman Hayes, Rachel M wrote: Hi All, I'm trying to automate a data summary using summary or describe from the HMisc package. I want to

[R] offlist .... heads up Re: getting a timeseries element into a string

2009-07-12 Thread David Winsemius
On Jul 12, 2009, at 8:10 AM, tradenet wrote: I added a reproducible example to my question... ts-dummyDailySeries(x = rnorm(365), units = NULL, zone = , FinCenter = ) Heads up is an English colloquial warning. It may be reproducible on a machine that has all of your particular

[R] ERROR message while using -invMillsRatio()

2009-07-12 Thread saurav pathak
Hi I have been trying so many different things to get my Inverse Mills Ratio going for a Two stage Heckman Model, I have tried the following so far (the commands are listed below till teh point where I get an error), I get an error in the last sentence (marked in bold below), if this were

Re: [R] getting a timeseries element into a string

2009-07-12 Thread David Winsemius
On Jul 12, 2009, at 1:05 PM, David Winsemius wrote: On Jul 12, 2009, at 8:10 AM, tradenet wrote: I added a reproducible example to my question... ts-dummyDailySeries(x = rnorm(365), units = NULL, zone = , FinCenter = ) Heads up is an English colloquial warning. It may be

Re: [R] (no subject)

2009-07-12 Thread John Kane
I have no idea to be honest. I have never used the package, I simply did a search for it. Hopefully a more experienced user can help --- On Sun, 7/12/09, maram salem marammagdysa...@yahoo.com wrote: From: maram salem marammagdysa...@yahoo.com Subject: Re: [R] (no subject) To: John Kane

[R] for (n in SystemResults$EnTime) return EnTime[n] until reaching (all)

2009-07-12 Thread Mark Knecht
Hi, Newbie alert on for loops... I have a bunch of data.frames built using rbind that have repeated values in the EnTime column. I want to read the value in the EnTime column and use it as an input to a function, but only down to the first occurrence of the string (all) where I want to

Re: [R] for (n in SystemResults$EnTime) return EnTime[n] until reaching (all)

2009-07-12 Thread Mark Knecht
On Sun, Jul 12, 2009 at 11:53 AM, Mark Knechtmarkkne...@gmail.com wrote: SNIP So this gets better in terms of error messages but still has problems for(n in SystemResults$EnTime) { if ( SystemResults$EnTime[n] == (all)) break else X = SystemResults$EnTime[n] print(X) } for(n

[R] Fw: (no subject)

2009-07-12 Thread maram salem
Dear group, Thank u so much 4 ur help. I've tried the link, http://finzi.psych.upenn.edu/R/library/quantreg/html/akj.html for adaptive kernel density estimation. But since I'm an R beginer and the topic of adaptive estimation is new for me, i still can't figure out some of the arguments of

Re: [R] for (n in SystemResults$EnTime) return EnTime[n] until reaching (all)

2009-07-12 Thread David Winsemius
On Jul 12, 2009, at 2:53 PM, Mark Knecht wrote: Hi, Newbie alert on for loops... I have a bunch of data.frames built using rbind that have repeated values in the EnTime column. I want to read the value in the EnTime column and use it as an input to a function, but only down to the first

Re: [R] Adaptive kernel density was ... Fw: (no subject)

2009-07-12 Thread David Winsemius
On Jul 12, 2009, at 3:21 PM, maram salem wrote: Dear group, Thank u so much 4 ur help. I've tried the link, http://finzi.psych.upenn.edu/R/library/quantreg/html/akj.html for adaptive kernel density estimation. But since I'm an R beginer and the topic of adaptive estimation is new for me, i

Re: [R] for (n in SystemResults$EnTime) return EnTime[n] until reaching (all)

2009-07-12 Thread David Winsemius
On Jul 12, 2009, at 3:35 PM, David Winsemius wrote: On Jul 12, 2009, at 2:53 PM, Mark Knecht wrote: As a test I tried to print down to the string (all) and then break but this code and everything I've tried so far is terribly wrong. Every attempt prints lots of error messages. I'm not

Re: [R] help! Error in using Boosting...

2009-07-12 Thread Patrick Connolly
On Fri, 10-Jul-2009 at 09:41AM -0700, Michael wrote: | Here is my code: | mygbm-gbm.fit(y=mytraindata[, 1], x=mytraindata[, -1], | interaction.depth=4, shrinkage=0.001, n.trees=2, bag.fraction=1, | distribution=bernoulli) | | Here is the error: | Error in gbm.fit(y = mytraindata[, 1], x =

Re: [R] for (n in SystemResults$EnTime) return EnTime[n] until reaching (all)

2009-07-12 Thread Mark Knecht
On Sun, Jul 12, 2009 at 1:05 PM, David Winsemiusdwinsem...@comcast.net wrote: On Jul 12, 2009, at 3:35 PM, David Winsemius wrote: On Jul 12, 2009, at 2:53 PM, Mark Knecht wrote:  As a test I tried to print down to the string (all) and then break but this code and everything I've tried so

Re: [R] for (n in SystemResults$EnTime) return EnTime[n] until reaching (all)

2009-07-12 Thread Rolf Turner
On 13/07/2009, at 8:05 AM, David Winsemius wrote: Appears I am wrong about this. I was basing my assumption on this interaction with the R interpreter: ?break Error in genericForPrimitive(f) : methods may not be defined for primitive function break in this version of R Since ``break''

Re: [R] Adaptive kernel density was ... Fw: (no subject)

2009-07-12 Thread roger koenker
On Jul 12, 2009, at 2:56 PM, David Winsemius wrote: On Jul 12, 2009, at 3:21 PM, maram salem wrote: Dear group, Thank u so much 4 ur help. I've tried the link, http://finzi.psych.upenn.edu/R/library/quantreg/html/akj.html for adaptive kernel density estimation. But since I'm an R beginer

Re: [R] variance explained by each predictor in GAM

2009-07-12 Thread Kayce Anderson
Hi, I am using mgcv:gam and have developed a model with 5 smoothed predictors and one factor. gam1 - gam(log.sp~ s(Spr.precip,bs=ts) + s(Win.precip,bs=ts) + s( Spr.Tmin,bs=ts) + s(P.sum.Tmin,bs=ts) + s( Win.Tmax,bs=ts) +factor(site),data=dat3) The total deviance explained = 70.4%. I would

[R] How can I test for End-Of-FIle

2009-07-12 Thread mauede
I have a long text file with uneven record length and variable structure. Therefore I have to read it line-by-line. I found out I can open a connection to the file and read in one line at a time. Something like: con - file(MyFle.txt,r) while (End-Of-File) { line - readLines(con,n=1)

[R] Splitting dataset for Tuning Parameter with Cross Validation

2009-07-12 Thread Tim
Hi, My question might be a little general. I have a number of values to select for the complexity parameters in some classifier, e.g. the C and gamma in SVM with RBF kernel. The selection is based on which values give the smallest cross validation error. I wonder if the randomized splitting

[R] package help [was: Re: R-help Digest, Vol 77, Issue 13]

2009-07-12 Thread Ben Bolker
Neotropical bat risk assessments-2 wrote: Hi all, Where can I find detail of use of seewave? Seems no help included in the package using ??seewave does not provide anything. help(package=seewave) which includes information on a vignette. Please try to remember to use an

Re: [R] Heckman Selection Model/Inverse Mills Ratio

2009-07-12 Thread Uli Kleinwechter
Dear Saurav, If you don't wish to calculate it by hand, you can extract the Inverse Mill's Ratio using the function invMillsRatio from the sampleSelection package. (http://cran.r-project.org/web/packages/sampleSelection/index.html). You can also use the heckit function in the same package

[R] Installing Eclipse Plug-In for R: StatET

2009-07-12 Thread Debabrata Midya
Dear R users, Thanks in advance. I am using R 2.9.1 on Windows XP. I am trying to install above, but faced problem. I have described the steps below. 1. I like to install locally. That means I like to install after downloading the required files into my hard drive. 2. Java Runtime

Re: [R] How can I test for End-Of-FIle

2009-07-12 Thread jim holtman
You can do something like this: con - file(MyFle.txt,r) repeat { line - readLines(con,n=1) if (length(line) == 0) break ParseLine(line) } On Sun, Jul 12, 2009 at 6:20 PM, mau...@alice.it wrote: I have a long text file with uneven record length and variable structure. Therefore I have

Re: [R] variance explained by each predictor in GAM

2009-07-12 Thread David Winsemius
On Jul 12, 2009, at 5:06 PM, Kayce Anderson wrote: Hi, I am using mgcv:gam and have developed a model with 5 smoothed predictors and one factor. gam1 - gam(log.sp~ s(Spr.precip,bs=ts) + s(Win.precip,bs=ts) + s( Spr.Tmin,bs=ts) + s(P.sum.Tmin,bs=ts) + s( Win.Tmax,bs=ts)

Re: [R] Heckman Selection MOdel Help in R

2009-07-12 Thread Arne Henningsen
Hi Saurav! On Sun, Jul 12, 2009 at 6:06 PM, Pathak, Sauravs.patha...@imperial.ac.uk wrote: I am new to R, I have to do a 2 step Heckman model, my selection equation is below which I was successful in running but I am unable to proceed further, I have so far used the following command

[R] Strange error in qplot

2009-07-12 Thread megh
Hi all, whenever I try to plot a histogram using qplot() function of ggplot2 library, I get error like this : qplot(rnorm(1000), geom=histogram, binwidth=0.2, main = , xlab=, ylab=) Error in scale[[1]] : subscript out of bounds However if I remove ylab= argument, then it is working fine. Am I

Re: [R] error: optim(rho, n2ll.rho, method = method, control = control, beta = parm$beta, : initial value in 'vmmin' is not finite

2009-07-12 Thread spencerg
I have not used 'sna'. Have you tried using debug to walk through the code line by line, examining and even changing things at will? For example, how big is rho, passed as starting values to optim? If that matches the size of your adjacency matrix, it could expose a

Re: [R] strata -- really slow performance

2009-07-12 Thread Marc Schwartz
On Jul 11, 2009, at 8:42 PM, Jonathan Greenberg wrote: I'm a bit confused why the following command is taking an extrodinarily long time ( 2-3 hours) to run on an 3.06ghz iMac (brand new). I'm trying to do a stratified random sample, drawing only a single value per UniqueID from the

Re: [R] getting a timeseries element into a string

2009-07-12 Thread Ron Burns
Here is what I do: R library(fBasics) R ts-dummyDailySeries(x = rnorm(365), units = NULL, zone = , FinCenter =) R class(ts) [1] timeSeries attr(,package) [1] timeSeries R (s - as.character(time(ts)[1])) [1] 1970-01-01 R class(s) [1] character tradenet wrote: I added a reproducible

[R] how to keep row name if there is only one row selected from a data frame

2009-07-12 Thread Weiwei Shi
Hi, there: Assume I have a dataframe with rownames like A with rownames like a to e, A [,1] [,2] a16 b27 c38 d49 e5 10 when I use A[1,], I lost the rowname for it, like below. How could I keep it? Is there an easy way instead that I have to modify by

[R] Fleiss Kappa

2009-07-12 Thread Sunita22
Hello Everyone I am calculating Fleiss Kappa, I have 28 raters, 5 Subjects and 5 ratings. The problem is that there are 2 missing values in the data. Would it better to replace those with 0 or should those be omitted? By omission I will be left wit only 3 subjects. and my second problem is

Re: [R] Strange error in qplot

2009-07-12 Thread hadley wickham
Hi megh, Unfortunately there's a known bug which prevents you from setting the y axis title in this way. Instead you can do : qplot(...) + scale_y_continuous() I think I've figured out a work around and it will be fixed in a future release. Hadley On Mon, Jul 13, 2009 at 2:15 AM,

Re: [R] strata -- really slow performance

2009-07-12 Thread hadley wickham
In this simple example, it took less than half a second to generate the result. That is on a 2.93 Ghz MacBook Pro. So, for your data, the code would look something like this: system.time(DF.new - do.call(rbind,                              lapply(split(patch_summary,

Re: [R] how to keep row name if there is only one row selected from a data frame

2009-07-12 Thread Moshe Olshansky
Try A[1,,drop=FALSE] - see help(\[) --- On Mon, 13/7/09, Weiwei Shi helprh...@gmail.com wrote: From: Weiwei Shi helprh...@gmail.com Subject: [R] how to keep row name if there is only one row selected from a data frame To: r-h...@stat.math.ethz.ch r-h...@stat.math.ethz.ch Received: Monday,

Re: [R] how to keep row name if there is only one row selected from a data frame

2009-07-12 Thread hadley wickham
On Mon, Jul 13, 2009 at 5:55 AM, Weiwei Shihelprh...@gmail.com wrote: Hi, there: Assume I have a dataframe with rownames like A with rownames like a to e, A  [,1] [,2] a    1    6 b    2    7 c    3    8 d    4    9 e    5   10 when I use A[1,], I lost the rowname for it, like below.