Re: [R] Coefficients paths - comparison of ridge, lasso and elastic net regression

2013-06-09 Thread Colstat
Hi, beginner Do you have reproducible data? I think your question is more related to statistical learning theory than R. You may want to watch Prof.Hastie's webinar. http://www.stanford.edu/~hastie/lectures.htm On Wed, Jun 5, 2013 at 10:22 AM, beginner wrote: > I would like to compare models

[R] In optim() function, second parameter in par() missing

2011-09-05 Thread colstat
Hi, First time using the optim(), can someone please tell me what I am doing wrong? The error looks like this Error in .Internal(pnorm(q, mean, sd, lower.tail, log.p)) : 'sd' is missing An example of the error dat = c(20, 19, 9, 8, 7, 4, 3, 2) dat_mu=mean(dat) dat_s=sd(dat) max.func = funct

Re: [R] In optim() function, second parameter in par() missing

2011-09-05 Thread colstat
Thanks, David. You suggestion worked very well. The par() in optim() only takes one argument, so I combine it into a vector. Now, I will run it with my actual code and see what happens. Colin -- View this message in context: http://r.789695.n4.nabble.com/In-optim-function-parameter-in-par-miss

Re: [R] In optim() function, second parameter in par() missing

2011-09-15 Thread colstat
Hi, David I happened to see this http://www.unc.edu/~monogan/computing/r/MLE_in_R.pdf And they wrote optim(c(0,1),normal.lik1,y=y,method="BFGS") But it doesn't actually work, like you mentioned, it only takes 2 parameters, is that the reason why. R gives this error > optim(par=parameters, normal.

[R] Data analysis: normal approximation for binomial

2011-11-19 Thread Colstat
Dear R experts, I am trying to analyze data from an article, the data looks like this Patient Age Sex Aura preCSM preFreq preIntensity postFreq postIntensity postOutcome 1 47 F A 4 6 9 2 8 SD 2 40 F A/N 5 8 9 0 0 E 3 49 M N 5 8 9 2 6 SD 4 40 F A 5 3 10 0 0 E 5 42 F N 5 4 9 0 0 E 6 35 F N 5 8 9 12

Re: [R] Data analysis: normal approximation for binomial

2011-11-20 Thread Colstat
ost > measurement). However, given at least what I know about migraines, it > is often a fairly chronic condition so over a relatively short time > period, it seems implausible to conclude that as many people would be > improving as this study reported. > > Cheers, > > Jo

Re: [R] Data analysis: normal approximation for binomial

2011-11-20 Thread Colstat
&hl=en&ei=nQHJTo7LPIrf0gHxs6Aq&sa=X&oi=book_result&ct=result&resnum=2&ved=0CC0Q6AEwAQ#v=onepage&q=z-test%20with%20continuity%20correction&f=false > > A print source that, IIRC, has a discussion of this is "Hayes, W. (1981. > Statistics. 3rd Ed., Holt

Re: [R] Should data for the linear mixed model analysis meet the three assumptions of ANOVA?

2011-12-18 Thread Colstat
I am working on similar stuff. I use aov(), I didn't use any package. And here's what I've been looking at http://www.gardenersown.co.uk/Education/Lectures/R/anova.htm http://www.personality-project.org/r/r.anova.html HTH On Sun, Dec 18, 2011 at 11:20 AM, David Winsemius wrote: > > On Dec 17, 201

[R] Plotting leapfrog in R

2012-04-12 Thread Colstat
Dear List Is there a package for leapfrog plotting (Hamiltonian Monte Carlo estimation) in R? I tried the actual "LEAPFrOG" package which doesn't actually give the plot like this one? http://xianblog.files.wordpress.com/2010/09/hamilton.jpg How doe one plot this in R? So, there semi-circle and

[R] How to see a R function's code

2012-02-11 Thread Colstat
I was wondering how do I actually see what's inside a function, say, density of t distribution, dt()? I know for some, I can type the function name inside R and the code will be displayed. But for dt(), I get > dt function (x, df, ncp, log = FALSE) { if (missing(ncp)) .Internal(dt(x,