Re: [R] Binary response GLM Question

2011-06-04 Thread casperyc
Hi Josh, Thank you for your reply. The reason I thank "Y" (0 and 1) here as p is because I think each observation is just a bernulli trial, so in this case the binomial n=1. And yet R still fits it (with the logit link) . I know the expression for the logit link, so I assumed I can take y here as

Re: [R] How to convert a factor column into a numeric one?

2011-06-04 Thread Robert A LaBudde
Thanks! Exactly what I wanted, as the same as Jorge also suggested. At 12:49 AM 6/5/2011, Dennis Murphy wrote: Hi: Try this: > dd <- data.frame(a = factor(rep(1:5, each = 4)), + b = factor(rep(rep(1:2, each = 2), 5)), + y = rnorm(20)) > str(dd) 'data.frame':

Re: [R] How to convert a factor column into a numeric one?

2011-06-04 Thread Robert A LaBudde
Thanks for your help. As far as your question below is concerned, the data frame arose as a result of some data cleaning on an original data frame, which was changed into a table, modified, and changed back to a data frame: ttcrmean<- as.table(by(ngbe[,'Log10'], list(Time=ngbe$Time,Temp=ngbe

Re: [R] How to convert a factor column into a numeric one?

2011-06-04 Thread Robert A LaBudde
Exactly! Thanks. At 12:49 AM 6/5/2011, Jorge Ivan Velez wrote: Dr. LaBudde, Perhaps as.numeric(as.character(x)) is what you are looking for. HTH, Jorge On Sun, Jun 5, 2011 at 12:31 AM, Robert A. LaBudde <> wrote: I have a data frame: > head(df) Time Temp Conc ReplLog10 10 -20

Re: [R] How to convert a factor column into a numeric one?

2011-06-04 Thread Joshua Wiley
Hi Robert, Try this: ## Example data converting mtcars to factors testdf <- as.data.frame(lapply(mtcars, factor)) str(testdf) ## taking advantage of assignment methods to avoid an explicit call to as.data.frame ## convert factor to numeric using the technique recommended in ?factor testdf[] <- l

Re: [R] How to convert a factor column into a numeric one?

2011-06-04 Thread Jorge Ivan Velez
Dr. LaBudde, Perhaps as.numeric(as.character(x)) is what you are looking for. HTH, Jorge On Sun, Jun 5, 2011 at 12:31 AM, Robert A. LaBudde <> wrote: > I have a data frame: > > > head(df) > Time Temp Conc ReplLog10 > 10 -20H1 6.406547 > 22 -20H1 5.738683 > 3

Re: [R] How to convert a factor column into a numeric one?

2011-06-04 Thread Dennis Murphy
Hi: Try this: > dd <- data.frame(a = factor(rep(1:5, each = 4)), + b = factor(rep(rep(1:2, each = 2), 5)), + y = rnorm(20)) > str(dd) 'data.frame': 20 obs. of 3 variables: $ a: Factor w/ 5 levels "1","2","3","4",..: 1 1 1 1 2 2 2 2 3 3 ... $ b: Factor w/ 2 l

[R] How to convert a factor column into a numeric one?

2011-06-04 Thread Robert A. LaBudde
I have a data frame: > head(df) Time Temp Conc ReplLog10 10 -20H1 6.406547 22 -20H1 5.738683 37 -20H1 5.796394 4 14 -20H1 4.413691 504H1 6.406547 774H1 5.705433 > str(df) 'data.frame': 177 obs. of 5 variabl

Re: [R] Binary response GLM Question

2011-06-04 Thread Joshua Wiley
Hi, Y is not the same as P. P is the conditional probability given the data matrix. So theoretically, P can take on any value in [0, 1], which means the odds can be anywhere from [0, +infty], not just 0 or undefined. In logistic regression, the logit link is pretty standard, so I do not think y

Re: [R] Partial Matching

2011-06-04 Thread Gabor Grothendieck
On Sat, Jun 4, 2011 at 6:44 PM, Abraham Mathew wrote: > Let's say that I have a string and I want to know if a single word > is present in the string. I've written the following function to see if > the word "Geico" is mentioned in the string "Cheap Geico car insurance". > However, it doesn't work

[R] Binary response GLM Question

2011-06-04 Thread casperyc
Hi all, I have a problem with binary response data in GLM fitting. The problem is that the "y" take only 1 or 0, and if I use logit link, it is the log of the odds ratio, which is p/(1-p). In my situation, think "y" is "p", so sometimes the odds is 0, sometimes it is "1/0", which is (should be) un

[R] Partial Matching

2011-06-04 Thread Abraham Mathew
Let's say that I have a string and I want to know if a single word is present in the string. I've written the following function to see if the word "Geico" is mentioned in the string "Cheap Geico car insurance". However, it doesn't work, and I assume it has something to do with the any() function.

[R] Interpreting Quantile Regression

2011-06-04 Thread cachai
Hey there! In normal Regression if p>=alpha, there is no significance. If i get this in quantile regression (for every tau), can I conclude, that there is no relationship between x and y? -- View this message in context: http://r.789695.n4.nabble.com/Interpreting-Quantile-Regression-tp3574216p35

Re: [R] Interpreting Quantile Regression

2011-06-04 Thread Frank Harrell
This is not really an R question, and it indicates that you have a good deal of studying to do about quantile regression before you rely on it. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Interpreting-

Re: [R] cbind 3 or more matrices

2011-06-04 Thread Phil Spector
Jim - In what sense does cbind(A,B,C) not work? A = matrix(rnorm(10),5,2) B = matrix(rnorm(15),5,3) C = matrix(rnorm(20),5,4) cbind(A,B,C) [,1] [,2] [,3] [,4] [,5][,6] [1,] -0.54194873 -1.1105170 -0.479010 0.619911163 0.1610162 0.49028633 [2,]

Re: [R] cbind 3 or more matrices

2011-06-04 Thread baptiste auguie
A, B, C should have the same number of rows. mlist = replicate(3, matrix(rnorm(6), 2), simplify=FALSE) names(mlist) = LETTERS[seq_along(mlist)] with(mlist, cbind(A,B,C)) or, do.call(cbind, mlist) HTH, baptiste On 5 June 2011 11:14, Jim Silverton wrote: > How can I cbind three or more matrice

Re: [R] cbind 3 or more matrices

2011-06-04 Thread Sarah Goslee
do.call(cbind, list(A, B, C)) On Sat, Jun 4, 2011 at 7:14 PM, Jim Silverton wrote: > How can I cbind three or more matrices like A,B and C. This does not work: > > cbind(A,B,C) > > > -- > Thanks, > Jim. > -- Sarah Goslee http://www.functionaldiversity.org _

Re: [R] cbind 3 or more matrices

2011-06-04 Thread Jim Silverton
How can I cbind three or more matrices like A,B and C. This does not work: cbind(A,B,C) -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] nonparametric logistic regression based on locally weighted scatterplot smoothing (lowess)

2011-06-04 Thread Thomas Lumley
Actually they say they used SAS, and Googling for "SAS local linear logistic" suggests they used PROC GAM with the LOESS() smoother. Probably quite similar to gam::gam(). -thomas On Sun, Jun 5, 2011 at 9:12 AM, Thomas Lumley wrote: > The Stanform gam()  [gam package] has choices of spline or

Re: [R] nonparametric logistic regression based on locally weighted scatterplot smoothing (lowess)

2011-06-04 Thread Thomas Lumley
The Stanform gam() [gam package] has choices of spline or local-polynomial (defaulting to local-linear) smoothers. That's probably the best match for the description. It shouldn't be necessary to guess -- the paper should have cited the package -- but we know that is often missed. -thomas

Re: [R] packages for power law distribution

2011-06-04 Thread Thomas Lumley
There's code at http://tuvalu.santafe.edu/~aaronc/powerlaws/ -thomas On Sun, Jun 5, 2011 at 9:01 AM, fernando del bon wrote: > > > > > > >        p { margin-bottom: 0.08in; } > > Dear All, > > I will appreciate some > suggestions of R packages for "ESTIMATION OF THE EXPONENT OF > POWER-LAW FR

[R] packages for power law distribution

2011-06-04 Thread fernando del bon
p { margin-bottom: 0.08in; } Dear All, I will appreciate some suggestions of R packages for "ESTIMATION OF THE EXPONENT OF POWER-LAW FREQUENCY DISTRIBUTIONS". I have been searching at the R-help list several keywords for this subject and I did not find a ver

[R] using Tps function

2011-06-04 Thread Tania S Pena-Baca
Hi, I'm using the Tps function of the fields package to plot 2D surfaces. My problem is that some arrays have a lot of zeroes and this function fits the data in a way that contour lines for zero are all over the place. Sometimes there are lines where there shouldn't be any that extend from the pa

[R] Predicted values based on fixed effects do not correspond with actual data in cross-classified generalized linear mixed model (lmer)

2011-06-04 Thread Gert
Dear R-Users, I have fitted a cross-classified generalized linear mixed model using the lmer package with the following code. Mod<-lmer(y~x+(1|a)+(1|b)+ (1|c), family=binomial) In this case, only including a covariate (x) as a fixed effect. The fitted values, using fitted(mod), correspond to t

Re: [R] Problem with Snowball & RWeka

2011-06-04 Thread A N
I too have this problem. Everything worked fine last year, but after updating R and packages I can no longer do word stemming. Unfortunately, I didn't save the old binaries, otherwise I would just revert back. Hoping someone finds a solution for R on Windows. Thanks! There is a potential solution

Re: [R] nonparametric logistic regression based on locally weighted scatterplot smoothing (lowess)

2011-06-04 Thread Bert Gunter
Take a look at packages mgcv or gam (and probably others). Different smoothers are used, but it's nonlinear, nonparametric logistic regression. which is usually the important part. It also penalizes, which can be even more important than which smoother is used. -- Bert On Sat, Jun 4, 2011 at 9:02

[R] Nonlinear model fitting of numerical integral function

2011-06-04 Thread arzensekd
Dear R List-Members, I wish to find the nonlinear least squares of function defined by an integral which must be evaluated numerically. Is that possible to implement in R? If it is possible, which problems I need to consider first? Many Thanks, Dejan -- View this message in context: http://r

Re: [R] OAuthFactory error

2011-06-04 Thread Uwe Ligges
What have you actually tried? Please read the posting guide. It also tells you to specify version numbers and OS. New vesions are on its way to CRAN. So we can neitehr reproduce (without your code) nor know which version you are trying. Uwe Ligges On 04.06.2011 19:46, hawkhandler wrote: i

Re: [R] modify a data frame by values in the columns

2011-06-04 Thread Peter Ehlers
On 2011-06-04 11:11, Peter Ehlers wrote: On 2011-06-03 13:34, Jason024 wrote: I have a data frame like this: col1 col2 r1 21 r2 43 r3 65 r4 87 r5109 r612 11 r714 13 r816 15 r918 17 r10 20 19 I want to modify this data fr

Re: [R] modify a data frame by values in the columns

2011-06-04 Thread Peter Ehlers
On 2011-06-03 13:34, Jason024 wrote: I have a data frame like this: col1 col2 r1 21 r2 43 r3 65 r4 87 r5109 r612 11 r714 13 r816 15 r918 17 r10 20 19 I want to modify this data frame, for example, assign every row in colum

[R] OAuthFactory error

2011-06-04 Thread hawkhandler
i'm trying to create an new OAuthFactory variable for twitter but when i run the handshake i get the following error: Error in FUN(c("key", "secret", : unused argument(s) (post.amp = TRUE) has anyone seen this before or have any suggestions. thanks ahead -- View this message in context: h

Re: [R] R Crashes when using "large" matrices (Ubuntu 11.04)

2011-06-04 Thread Douglas Bates
On Fri, Jun 3, 2011 at 7:03 PM, Matias Salibian-Barrera wrote: > Hello, > > This simple SVD calculation (commands are copied immediately below) crashes > on my Ubuntu machine (R 2.13.0). However it works fine on my Windows 7 > machine, so I suspect there's a problem with (my?) Ubuntu and / or R.

Re: [R] LM/two way analysis/classic parametrisation

2011-06-04 Thread David Winsemius
On Jun 4, 2011, at 10:33 AM, kfl wrote: I will be pleased to know, how to get the classic parametrisation in a two way analysis of varians: Classic parametrisation: Observed = intercept + row-effect + col-effect+ error, where sum af row-effect=0 and sum of col_effect=0 ?contrasts # which h

[R] LM/two way analysis/classic parametrisation

2011-06-04 Thread kfl
I will be pleased to know, how to get the classic parametrisation in a two way analysis of varians: Classic parametrisation: Observed = intercept + row-effect + col-effect+ error, where sum af row-effect=0 and sum of col_effect=0 -- View this message in context: http://r.789695.n4.nabble.com/

Re: [R] nonparametric logistic regression based on locally weighted scatterplot smoothing (lowess)

2011-06-04 Thread David Winsemius
On Jun 4, 2011, at 11:41 AM, zhu yao wrote: Dear UseRs: Recently, I have read an article regarding the association between age and lymph node metastases. http://jco.ascopubs.org/content/27/18/2931.long In statistical analysis, the authors stated "Because a nonlinear relationship between age

[R] nonparametric logistic regression based on locally weighted scatterplot smoothing (lowess)

2011-06-04 Thread zhu yao
Dear UseRs: Recently, I have read an article regarding the association between age and lymph node metastases. http://jco.ascopubs.org/content/27/18/2931.long In statistical analysis, the authors stated "Because a nonlinear relationship between age and lymph node involvement was expected based on e

Re: [R] outlining data points

2011-06-04 Thread David Winsemius
On Jun 3, 2011, at 7:20 PM, lana wrote: Hi, I have tried numerous methods and packages, but thus far cannot seem to find a solution. I am looking to essentially draw a filled colored shape around subsets on my data points on a scatter plot where none of the shapes overlap but instead

Re: [R] [R-SIG-Finance] Measure quality of fit for MA(q), ARMA(p, q) and GARCH(p, q)

2011-06-04 Thread Robert A'gata
Thank you so much all for your invaluable inputs. On Sat, Jun 4, 2011 at 3:36 AM, Patrick Burns wrote: > A common thing to do is the Ljung-Box > test on the residuals.  For garch it > would be the residuals squared. > > Actually for garch it should be the > rank of the squared residuals -- see >

Re: [R] Checking and building package

2011-06-04 Thread Uwe Ligges
On 04.06.2011 09:37, Petar Milin wrote: Dear Uwe, Please, can you help me with this? I simplified the situation: I am using Debian testing i386 (also, I have VirtualBox with Win XP on it) myPackage is the name of the package and foo.c is in the src/ in NAMESPACE I put: useDynLib("foo") export("

[R] library(SenoMineR)- Triangle Test Query

2011-06-04 Thread Vijayan Padmanabhan
Dear R Group I was trying to use the triangle.test function in SensoMineR and strangely i encounter a error in the output of preference matrix from the analysis. To illustrate, pl see the following dataframe of a design with the response and preference collected as shown below: design<-structure(l

Re: [R] R Crashes when using "large" matrices (Ubuntu 11.04)

2011-06-04 Thread Prof. John C Nash
On Ubuntu 10.04 it ran fine, albeit in a machine with lots of memory, it seems to work fine. Here's the output: > rm(list=ls()) > gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 131881 7.1 35 18.7 35 18.7 Vcells 128838 1.0 786432 6.0 559631 4.3 > p <- 500 > n <

Re: [R] Superscripts in strip labels of lattice plot

2011-06-04 Thread Bert Gunter
Peter et, al: As a minor note ,,, On Fri, Jun 3, 2011 at 8:00 PM, Peter Ehlers wrote: > David has given you the answer. I'll just add that you might > want to widen the strips a bit if you use superscripted factor levels: > >  xyplot(Sepal.Length ~ Sepal.Width | Species, data = iris, >      st

[R] Bootstrap or Wilks ?

2011-06-04 Thread thibault.charles
Dear R-users, The following question is more a statistic question than a R issue. I would like to know the difference between the two following non parametric technics : the bootstrap and the Wilks formula. I understand well the theory about the two technics but cannot find anything about their

Re: [R] Value of 'pi'

2011-06-04 Thread Ted Harding
I asked a radiographer friend of mine to examine this suggestion, but he said it wouldn't scan. Ted. On 04-Jun-11 04:04:43, John wrote: > Last line, try > > "but one can't, for Pi is transcendental." > > > On Friday, June 03, 2011 04:12:07 AM Jim Lemon wrote: >> On 06/01/2011 10:14 AM, baptis

Re: [R] generating random covariance matrices (with a uniform distribution of correlations)

2011-06-04 Thread Petr Savicky
On Fri, Jun 03, 2011 at 01:54:33PM -0700, Ned Dochtermann wrote: > Petr, > This is the code I used for your suggestion: > > k<-6;kk<-(k*(k-1))/2 > x<-matrix(0,5000,kk) > for(i in 1:5000){ > A.1<-matrix(0,k,k) > rs<-runif(kk,min=-1,max=1) > A.1[lower.tri(A.1)]<-r

Re: [R] movie3d in rgl object 'movie' not found

2011-06-04 Thread Prof Brian Ripley
On Fri, 3 Jun 2011, someone ashamed of his/her real name wrote: Hello, I am trying to save a .gif movie using movie3d from the package {rgl}. I am using the following code combined with the globe example on the ?movie3d page. I've installed ImageMagick and the directory seems to be working pr

[R] logistic growth model

2011-06-04 Thread Renalda
I want to Fit a logistic growth model for y = k *eb0+b1(age)/1 + eb0+b1(age), can some one help on how to get the initial coefficients b0 and b1? I need to estimate in order to do the regression analysis. When I run using b0=0.5 and b1=3.4818, I get the following error 397443.8 : 0.5 3.4818

[R] logistic growth model

2011-06-04 Thread magushi
HI I want to Fit a logistic growth model for this data set where y = k*exp(b0+b1(age))/1 + exp(bo+b1(age)), start = list(b0 = 3, b1 = 3.5 ), trace = TRUE) I need to find the initial valued for b0 and b1. K =3. When I run using b0=3 abd b1 = 3.5, or any number I get the follo

[R] outlining data points

2011-06-04 Thread lana
Hi, I have tried numerous methods and packages, but thus far cannot seem to find a solution. I am looking to essentially draw a filled colored shape around subsets on my data points on a scatter plot where none of the shapes overlap but instead bend around each other if necessary. I finally ca

[R] movie3d in rgl object 'movie' not found

2011-06-04 Thread harryxgordon
Hello, I am trying to save a .gif movie using movie3d from the package {rgl}. I am using the following code combined with the globe example on the ?movie3d page. I've installed ImageMagick and the directory seems to be working properly, i.e. when I do Sys.getenv("PATH"), C:\\Program Files (x86)\