Re: [R] In a formula, what is the interaction of the intercept and a factor?

2011-05-31 Thread Prof Brian Ripley
Try it for yourself: model.matrix(y ~ 1:group, data = dat) (Intercept) 11 ... Or to do 'interact "1+x" with "group"' model.matrix(y ~ (1+x):group, data = dat) (Intercept) x:groupA x:groupB 1101 ... Note that you usually want to do '*' when you

[R] different results from lme() and lmer()

2011-05-31 Thread Taro Miyagawa
Hello R-help, I'm studying an example in the R book.  The data file is available from the link below.http://www.bio.ic.ac.uk/research/mjcraw/therbook/data/fertilizer.txt Could you explain Why the results from lme() and lmer() are different in the following case? In other examples, I can get the

Re: [R] Problem with package development

2011-05-31 Thread Prof Brian Ripley
On Wed, 1 Jun 2011, Nipesh Bajaj wrote: I have been struggling for last one hour but not yet any through. However again I recreate the package.skeleton and run R CMD check trial3 Here are the errors: warning in dir.create(pkgoutdir, mode = "0755"): cannot create dir 'c:\Program files\R\R-2.13

Re: [R] nnet inappropriate fit for class error

2011-05-31 Thread Prof Brian Ripley
On Tue, 31 May 2011, Duygu Gunaydin wrote: Hi, I am trying to run a nnet algorithm but when I try to use the predict function with type='class', it gives the following error: fit <- nnet(y~., size = 1, data = train.set, rang = 0.5, maxit=200, decay = 0) predict<-predict(fit,test.set,type='cl

Re: [R] In a formula, what is the interaction of the intercept and a factor?

2011-05-31 Thread Kenn Konstabel
With some guessing: does lm(formula = y ~ -1 + group + x:group, data = dat) do what you want? I'm not sure now 1:group is treated, if at all. Kenn On Tue, May 31, 2011 at 11:35 PM, Kevin Wright wrote: > For a pedagogical purpose, I was trying to show how the formula for a simple > regression lin

Re: [R] Text Summarization

2011-05-31 Thread Ravishankar Rajagopalan
Mike, This is what I am looking for. http://en.wikipedia.org/wiki/Automatic_summarization I want to obtain a summary of a huge document as meaningful sentences. I do not want a bag of words as the output. I have 1000's of documents each one running to 3-4 pages. I plan to use R to do clustering/

[R] Clean up Rmpi when there is a bug in the code

2011-05-31 Thread Junsheng Ma
I am currently work on a research project which requires parallel technique. I have successfully adapted an Rmpi code from the following website. http://math.acadiau.ca/ACMMaC/Rmpi/task_pull.R and be able to run my own code now. However, since I am developing my own code which involves ma

Re: [R] count value changes in a column

2011-05-31 Thread Justin Haynes
I apologize for the confusion but that solution will work with a twist. I want to record only the first value of a state change that goes above 2. so if the sequence is 344455544334 it should read all 3s but 3442555414433 should read 33321 Hope that helps clarify, if not I can get ther

Re: [R] Forcing a negative slope in linear regression?

2011-05-31 Thread Rolf Turner
(1) You can easily force the slope to take on a *particular* value, positive or negative, by using offset(). However just to constrain the value of the slope to be less than or equal to 0 you'd have to do a constrained optimization of the sum of squares. Not hard to do, but probably (almost su

Re: [R] Forcing a negative slope in linear regression?

2011-05-31 Thread Bill.Venables
If you want to go ahead with this in cold blood, you might look at the 'nnls' package. It fits regressions with non-negative coefficients. This might seem like the very opposite of what you want, but it essentially gets you there. You have to be prepared for the coefficient to go to zero th

Re: [R] count value changes in a column

2011-05-31 Thread Bill.Venables
I thought so to. If so, here is one way you could do it fixSeq <- function(state) { shift1 <- function(x) c(1, x[-length(x)]) repeat { change <- state %in% c(4,5) & shift1(state) == 3 if(any(change)) state[change] <- 3 else break } state } e.g. > state [1] 1 3 3 5 5 3 2

Re: [R] Forcing a negative slope in linear regression?

2011-05-31 Thread Jeff Newmiller
If you force the slope, it is no longer a regression, so no. It is best to add those other dependent variables to the regression and evaluate whether their presence causes the fit to improve and yield signs of coefficients that match what you expect. -

[R] Zero-inflated regression models: predicting no 0s

2011-05-31 Thread Jean-Simon Michaud
Hi all, First post for me here, but I have been reading on the forum for almost two years now. Thanks to everyone who contributed btw! I have a dataset of 4000 observations of count of a mammal and I am trying to predict abundance from a inflated-zero model as there is quite a bit of zeros

[R] nnet inappropriate fit for class error

2011-05-31 Thread Duygu Gunaydin
Hi, I am trying to run a nnet algorithm but when I try to use the predict function with type='class', it gives the following error: fit <- nnet(y~., size = 1, data = train.set, rang = 0.5, maxit=200, decay = 0) predict<-predict(fit,test.set,type='class') Error in predict.nnet(fit, test.set, ty

Re: [R] count value changes in a column

2011-05-31 Thread jim holtman
Why isn't the sequence: 1 3 3 3 3 3 2 4 2 1 5 3 3 3 according to your rule about 5s following 3s. On Tue, May 31, 2011 at 6:23 PM, Justin Haynes wrote: > is there a way to look for value changes in a column? > > set.seed(144) > df<-data.frame(state=sample(rep(1:5,200),1000)) > > any of the five

Re: [R] Value of 'pi'

2011-05-31 Thread baptiste auguie
I propose a Pi Haiku (PIQ), Pi is of certain value, In statistics, invaluable, yet Transcending numerics. Best, baptiste On 1 June 2011 11:55, Ravi Varadhan wrote: > Nice to know that the `pi' can be sliced in so many different ways! > > There are exactly 3.154 x e08 seconds in a (non-leap) ye

[R] Statistics related question...compute RSE

2011-05-31 Thread Santosh
Dear Rxperts.. Is there a way to calculate RSE (relative standard error) of a %CV value if given a mean and its %CV? As an approximation, %CV = sqrt(variance). Thanks, Santosh [[alternative HTML version deleted]] __ R-help@r-project.org mailin

Re: [R] Value of 'pi'

2011-05-31 Thread Ravi Varadhan
Nice to know that the `pi' can be sliced in so many different ways! There are exactly 3.154 x e08 seconds in a (non-leap) year. So the error in your approximation is less than 0.4%. Ravi. From: Thomas Lumley [tlum...@uw.edu] Sent: Tuesday, May 31, 2011

[R] Forcing a negative slope in linear regression?

2011-05-31 Thread J S
Dear forum members, How can I force a negative slope in a linear regression even though the slope might be positive? I will need it for the purpose of determining the trend due reasons other than biological because the biological (genetic) trend is not positive for these data. Thanks. Juli

Re: [R] Problem with package development

2011-05-31 Thread Duncan Murdoch
On 11-05-31 4:58 PM, Nipesh Bajaj wrote: I have been struggling for last one hour but not yet any through. However again I recreate the package.skeleton and run R CMD check trial3 Here are the errors: warning in dir.create(pkgoutdir, mode = "0755"): cannot create dir 'c:\Program files\R\R-2.13

Re: [R] count value changes in a column [EDIT]

2011-05-31 Thread Justin
Justin Haynes gmail.com> writes: > > is there a way to look for value changes in a column? > > df<-data.frame(state=sample(rep(1:5,200),1000)) > > any of the five states are acceptable. however if, for example, > states 4 or 5 follow state 3, i want to overwrite them with 3. > changes from 1

Re: [R] Problem with % in an example when running R CMD check

2011-05-31 Thread Duncan Murdoch
On 11-05-31 5:12 PM, Peter Langfelder wrote: I observed the same behaviour some time ago. The .Rd files are pre-processed using a latex-like typesetter that discards everything following a % sign as comments, even in example R code. http://r.789695.n4.nabble.com/Rd-file-processing-suggestion-sig

[R] count value changes in a column

2011-05-31 Thread Justin Haynes
is there a way to look for value changes in a column? set.seed(144) df<-data.frame(state=sample(rep(1:5,200),1000)) any of the five states are acceptable. however if, for example, states 4 or 5 follow state 3, i want to overwrite them with 3. changes from 1 to any value and 2 to any value are ac

Re: [R] Plotting nondetects a different color

2011-05-31 Thread Peter Langfelder
On Tue, May 31, 2011 at 2:19 PM, David Doyle wrote: > I often have data sets that have nondetects in them.  For example > Result     Detected ( 0=No 1=Yes) > 14               1 > 20               1 > 10                0 > 19                1 > 12                0 > 9                   1 > 15      

Re: [R] newbie: fourier series for time series data

2011-05-31 Thread Mike Marchywka
( hotmail won't mark text so I'm top posting... ) Can you post the data? Personally I'd just plot abs(fft(x)) and see what you see, as well as looking at Im(fft(x))/Re(fft(x)) or phase spectrum. Now, presumably you are nominally looking for something with a period of 1 year, that part could be e

Re: [R] constructing nxn matrices involving calculations& conditions based on other tables

2011-05-31 Thread Luma r
Thanks Marco, sorry if my explanation was not the best, but your code did the trick. I managed to adjust the code to get exactly what I wanted. Thank you! Luisa On Mon, May 30, 2011 at 4:20 PM, Jabba wrote: > Hi Luisa, > > it was really difficult to manage to understand what you need. Assum

[R] Plotting nondetects a different color

2011-05-31 Thread David Doyle
I often have data sets that have nondetects in them. For example Result Detected ( 0=No 1=Yes) 14 1 20 1 100 191 120 9 1 151 I would like to be able to plots with the NonDetects one c

[R] Mantel - like analysis

2011-05-31 Thread serrouya
Hello, I've used mantel tests a fair bit for standard genetic/geographic/landscape analyses. I realize it involves permutations of rows and columns in the matrix to obtain correlation coefficients. However, for a certain question, I am interested in populations that are nearest neighbours to eac

Re: [R] Problem with % in an example when running R CMD check

2011-05-31 Thread Peter Langfelder
I observed the same behaviour some time ago. The .Rd files are pre-processed using a latex-like typesetter that discards everything following a % sign as comments, even in example R code. http://r.789695.n4.nabble.com/Rd-file-processing-suggestion-sign-in-examples-td3459570.html HTH, Peter On

[R] Problem with % in an example when running R CMD check

2011-05-31 Thread Frank Harrell
Using platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 2 minor 13.0

Re: [R] Problem with package development

2011-05-31 Thread Nipesh Bajaj
I have been struggling for last one hour but not yet any through. However again I recreate the package.skeleton and run R CMD check trial3 Here are the errors: warning in dir.create(pkgoutdir, mode = "0755"): cannot create dir 'c:\Program files\R\R-2.13.0\bin\trial3.Rcheck', reason .

Re: [R] Value of 'pi'

2011-05-31 Thread Thomas Lumley
On Wed, Jun 1, 2011 at 2:12 AM, Ravi Varadhan wrote: > > I have also heard (courtesy: John Nash) that `pi' is the ratio of actual time > it takes to complete your thesis to the anticipated time. And I find it a useful mnemonic that there are pi times ten million seconds in a year (accurate to b

[R] In a formula, what is the interaction of the intercept and a factor?

2011-05-31 Thread Kevin Wright
For a pedagogical purpose, I was trying to show how the formula for a simple regression line (~1+x) could be crossed with a factor (~1:group + x:group) to fit separate regressions by group. For example: set.seed(201108) dat <- data.frame(x=1:15, y=1:15+rnorm(15), group = sample(c('A',

Re: [R] how to tell if two file paths refer to the same file

2011-05-31 Thread Duncan Murdoch
On 11-05-31 3:46 PM, William Dunlap wrote: Does R have a standard function that takes two file paths (e.g., "./myDirectory/file" and "myDirectory/file") and returns TRUE if those paths refer to the same file? I don't think so. I think normalizePath is as close as we get portably. On Windows,

Re: [R] Please HELP

2011-05-31 Thread Rolf Turner
(1) Use an informative subject line. (2) Do not use html mail. Then you might get a response. cheers, Rolf Turner On 01/06/11 02:12, mustafabinar wrote: > Hi R people. >   > I have a problem. What can I create by using functions the > combinations of distances in multiple compar

Re: [R] How to get the rows corresponding to the maximum of a factor

2011-05-31 Thread David Winsemius
On May 31, 2011, at 2:51 PM, James Rome wrote: I have a data frame as follows: MsgTypeeotpd fn FI 2011-05-13 01:40:00 0 FF 2011-05-13 01:39:53 0 TC 2011-05-13 01:39:45 0 FI 2011-05-14 00:58:46 1 FF 2011-05-14 00

Re: [R] Problem with package development

2011-05-31 Thread Nipesh Bajaj
Actually partly I followed. Here is the more details what I have done so far: 1. Edit the help file skeletons in 'man', possibly combining help files for multiple functions. I have modified with following: \name{fn1} \alias{fn1} \title{ A function. } \description{ A function. } \usage{ A functi

[R] how to tell if two file paths refer to the same file

2011-05-31 Thread William Dunlap
Does R have a standard function that takes two file paths (e.g., "./myDirectory/file" and "myDirectory/file") and returns TRUE if those paths refer to the same file? The paths make take different routes ("absolute" or relative paths or via different symbolic or hard links) to the same file or may

Re: [R] Coercing in R and in C (R-Extensions)

2011-05-31 Thread Oliver
Oliver first.in-berlin.de> writes: [...] > Can you give a simple C-Code example / snippet, > so that I can see what I would need to do, when trying to > do that on the C-side? h 5.9.5: classes... I assume, that from C-side the effect is then working as expected on R-side... _

Re: [R] Problem with package development

2011-05-31 Thread Duncan Murdoch
On 11-05-31 3:36 PM, Nipesh Bajaj wrote: Dear all, I am having a strage problem while I was trying to build a package. Here is my package skeleton: fn1<- Vectorize(function(x,y,z) { return(x + y +z) }, vectorize.args = c("x"), SIMPLIFY = TRUE) package.skel

Re: [R] Coercing in R and in C (R-Extensions)

2011-05-31 Thread Oliver
Oliver first.in-berlin.de> writes: [...] > Can you give a simple C-Code example / snippet, > so that I can see what I would need to do, when trying > to do that on the C-side? ...hmhh maybe with attributes, as mentioned in section 5.9.4 __ R-help@r-pr

[R] Problem with package development

2011-05-31 Thread Nipesh Bajaj
Dear all, I am having a strage problem while I was trying to build a package. Here is my package skeleton: fn1 <- Vectorize(function(x,y,z) { return(x + y +z) }, vectorize.args = c("x"), SIMPLIFY = TRUE) package.skeleton("trial3",namespace = TRUE) However

Re: [R] how to add row index based a categorical column

2011-05-31 Thread xin wei
thank you everyone. how can I not be aware of the existence of ave()? I try the following: tapply(data$value, data$level, rank). However, I have a very difficult time merging the resulting rank variable back to the original data frame. thanks a lot! -- View this message in context: http://r.78

[R] while loop problems

2011-05-31 Thread Alon Honig
Hi , i am trying to get this loop in my r program to work but it is not giving me the results that I desire. I am trying to model an insurance contract where there are n securities that have a fixed likelihood of default vector(data[i,2]) and a payout vector(data[i,1]). i need to price the value o

Re: [R] Reading Data from mle into excel?

2011-05-31 Thread Hugh Patience
Greg that's it! Thank you thank you thank you So simple in the end? > From: greg.s...@imail.org > To: h_a_patie...@hotmail.com; r-help@r-project.org > Date: Tue, 31 May 2011 10:27:13 -0600 > Subject: RE: [R] Reading Data from mle into excel? > > I did not see any

Re: [R] OT: Pie charts

2011-05-31 Thread Alexander Engelhardt
Am 31.05.2011 21:10, schrieb Alexander Engelhardt: Please find attached a rather splendid use of pie charts. Do not question the pie chart. Pffft no attachment rule. http://www.medialogy.de/blog/wp-content/uploads/2008/09/pacmancharthumor.jpg __ R-he

Re: [R] OT: Pie charts

2011-05-31 Thread Alexander Engelhardt
Am 31.05.2011 20:15, schrieb Sarah Goslee: We regularly get questions about making pie charts, and frequently veer off into the philosophical and practical issues surrounding that form of data graphic: human perception of angles and so on. So while this isn't an R issue, I thought some of you mi

[R] filling in a dataframe with another dataframe

2011-05-31 Thread Dat Mai
Hello All, I have two dataframes and I wish to insert the values of one dataframe into another (let's call them DF1 and DF2). DF1 looks like this: col1.col2 a...1 b...2 c...3 d...4 e...5 f6 g...7 where col1 (which is just the first

[R] How to get the rows corresponding to the maximum of a factor

2011-05-31 Thread James Rome
I have a data frame as follows: MsgTypeeotpd fn FI 2011-05-13 01:40:00 0 FF 2011-05-13 01:39:53 0 TC 2011-05-13 01:39:45 0 FI 2011-05-14 00:58:46 1 FF 2011-05-14 00:58:46 1 FI 2011-05-15 00:48:32

Re: [R] Coercing in R and in C (R-Extensions)

2011-05-31 Thread Oliver
Duncan Murdoch gmail.com> writes: > > On 11-05-31 1:55 PM, Oliver wrote: [...] > > > > Maybe someone can explain me the problem in other words? > > > > What does coercion in R do, and what does coercion in C (not) do? > > > > (And what would be needed in C to get the same effect as in R?) > > C

Re: [R] newbie: fourier series for time series data

2011-05-31 Thread Oliver
To get an overview, you could just play around with fft() and spectrum(), two functions, which R offers by default (assuming you know Fourier Transformation). fft() gives you back complex spectrum. There also is a refcard that gives an overview on Time Series analysis from Vito Ricci: http://c

Re: [R] Coercing in R and in C (R-Extensions)

2011-05-31 Thread Duncan Murdoch
On 11-05-31 1:55 PM, Oliver wrote: Hello, in "Writing R Extensions" I found the following stuff: "Note that these coercion functions are not the same as calling as.numeric (and so on) in R code, as they do not dispatch on the class of the object. Thus it is normally preferable to do

[R] OT: Pie charts

2011-05-31 Thread Sarah Goslee
We regularly get questions about making pie charts, and frequently veer off into the philosophical and practical issues surrounding that form of data graphic: human perception of angles and so on. So while this isn't an R issue, I thought some of you might appreciate this brief discussion of the e

[R] Coercing in R and in C (R-Extensions)

2011-05-31 Thread Oliver
Hello, in "Writing R Extensions" I found the following stuff: "Note that these coercion functions are not the same as calling as.numeric (and so on) in R code, as they do not dispatch on the class of the object. Thus it is normally preferable to do the coercion in the calling R code."

Re: [R] DateTime Math in R - POSIXct

2011-05-31 Thread Jeff Newmiller
Although the documentation for as.POSIXct indicates that an origin string value will be converted using tz="GMT", it is actually converted using tz="" (=default timezone) and the result acquires that timezone rather than the tz argument timezone. As Dr. Ripley alluded, you need to use an origin

Re: [R] newbie: fourier series for time series data

2011-05-31 Thread Spencer Graves
On 5/31/2011 5:12 AM, eddie smith wrote: > Hi Guys, > > I had a monthly time series's data of land temperature from 1980 to 2008. > After plotting a scatter diagram, it seems that annually, there is a semi > sinusoidal cycle. How do I run Fourier's series to the data so that I can > fit model on it

[R] ENC: Using lm() combined with sapply

2011-05-31 Thread Filipe Leme Botelho
Hi Caio, I just replied to a fellow who needed to run a series of regressions changing the dependent variables for the same period. I believe your solution might be similar to that one, just making the window dynamic instead. I used a lapply to store regressions and sapplys to extract stats fro

[R] Latin Hypercube Sampling with a condition

2011-05-31 Thread Duarte Viana
Hello all, I am trying to do a Latin Hypercube Sampling (LHS) to a 5-parameter design matrix. I start as follows: library(lhs) p1<-randomLHS(1000, 5) If I check the distribution of each parameter (column), they are perfectly uniformly distributed (as expected).For example, hist(p1[,1]) Now th

Re: [R] creating a vector from a file

2011-05-31 Thread heimat los
On Tue, May 31, 2011 at 5:14 PM, David Winsemius wrote: > > On May 31, 2011, at 10:38 AM, David Winsemius wrote: > > >> On May 31, 2011, at 10:19 AM, heimat los wrote: >> >> On Tue, May 31, 2011 at 4:12 PM, Matt Shotwell >>> wrote: >>> >>> On Tue, 2011-05-31 at 15:36 +0200, heimat los wrote: >>

Re: [R] Three sigma rule

2011-05-31 Thread David Winsemius
On May 28, 2011, at 5:12 PM, David Winsemius wrote: On May 28, 2011, at 2:12 PM, Salil Sharma wrote: Dear Sir, I have data, coming from tests, consisting of 300 values. Is there a way in R with which I can confirm this data to 68-95-99.8 rule or three- sigma rule? Can you describe th

Re: [R] Compiling C-code in Windows

2011-05-31 Thread Smith, Dale
Try CC=gcc -mno-cygwin to avoid linking with the Cygwin dlls. Thanks, Dale Smith, Ph.D. Senior Financial Quantitative Analyst Risk & Compliance Fiserv. 107 Technology Park Norcross, GA 30092 Direct NYC: 212-419-3242 Direct Norcross: 678-375-5315 Mobile: 678-982-6599 Mail: dale.sm...@fiserv.com w

Re: [R] Odp: Three sigma rule

2011-05-31 Thread Thomas Levine
I think you really want a normality test. If that's what you want, you have more options than the three-sigma rule. http://en.wikipedia.org/wiki/Normality_test Tom On Tue, May 31, 2011 at 12:31 PM, Bert Gunter wrote: > Folks: > > On Tue, May 31, 2011 at 8:48 AM, Petr PIKAL wrote: >> Hi >> >> r

Re: [R] Compiling C-code in Windows

2011-05-31 Thread Duncan Murdoch
On 11-05-31 12:24 PM, Mike Marchywka wrote: Date: Tue, 31 May 2011 11:37:56 -0400 From: murdoch.dun...@gmail.com To: tom.osb...@iinet.net.au CC: r-h...@stat.math.ethz.ch; pmi...@ff.uns.ac.rs Subject: Re: [R] Compiling C-code in Windows On 31/05/2011

Re: [R] Odp: Three sigma rule

2011-05-31 Thread Bert Gunter
Folks: On Tue, May 31, 2011 at 8:48 AM, Petr PIKAL wrote: > Hi > > r-help-boun...@r-project.org napsal dne 28.05.2011 20:12:33: > >> "Salil Sharma" >> Odeslal: r-help-boun...@r-project.org >> Dear Sir, >> >> >> >> I have data, coming from tests, consisting of 300 values. Is there a way > in >> R

Re: [R] Reading Data from mle into excel?

2011-05-31 Thread Greg Snow
I did not see any code above, but you could write a simple function that does the mle fit (is this mle from the stats4 package?) then extracts the information that you want and puts it into a vector, something like: out <- c( coef(fit), sqrt(diag(vcov(fit))), ll=logLik(fit) ) And returns the ve

Re: [R] Compiling C-code in Windows

2011-05-31 Thread Mike Marchywka
> Date: Tue, 31 May 2011 11:37:56 -0400 > From: murdoch.dun...@gmail.com > To: tom.osb...@iinet.net.au > CC: r-h...@stat.math.ethz.ch; pmi...@ff.uns.ac.rs > > On 31/05/2011 7:50 AM, Tom Osborn wrote: > > You could use cygwin's cc/gcc, or the Watcom open

Re: [R] Is there a (virtual) class that all R objects inherit from?

2011-05-31 Thread Martin Morgan
On 05/30/2011 07:02 AM, Janko Thyson wrote: Dear list, I would like to set one specific Reference Class field to be of an arbitrary class. Is there a class that all R objects inherit from? I thought that "ANY" was something like this, but obviously that's not true: > inherits(1:3, "ANY") [1]

Re: [R] Need help reading website info with XML package and XPath

2011-05-31 Thread Martin Morgan
On 05/30/2011 09:04 AM, eric wrote: Hi, I'm looking for help extracting some information of the zillow website. I'd like to do this for the general case where I manually change the address by modifying the url (see code below). With the url containing the address, I'd like to be able to extract t

Re: [R] reshape::cast: invalid 'yinds' argument

2011-05-31 Thread Hadley Wickham
Hi Albert-Jan, It's impossible to know what went wrong without a reproducible example (https://github.com/hadley/devtools/wiki/Reproducibility). Without that, all I can recommend is trying out reshape2. Hadley On Tue, May 31, 2011 at 9:44 AM, Albert-Jan Roskam wrote: > Hi, > > I'm using reshap

[R] RES: Linear regression - several response variables vs few indvariables

2011-05-31 Thread Filipe Leme Botelho
--- Begin Message --- Hi Raphael, using your data as is, and if I understood what you need > birds Square Sp1 Sp2 Sp3 Sp4 Spn Natprop Effort [1,] 1 1 0 1 1 0 0.5 10 [2,] 2 1 0 1 1 0 0.6 20 [3,] 3 1 1 0 1 0 0.8 23 [4

[R] Identifying rows that violate association rules

2011-05-31 Thread Rashid Bakirov
Hello, I am successfully applying apriori Algorithm in arules package to basket-form data and am getting a set of association rules. Is there an easy way to know, which rows violate these rules? That is, if I have a rule {beer,vodka} => {gin}, I want to find rows which contain {beer,vodka}

Re: [R] Reading Data from mle into excel?

2011-05-31 Thread Bazman76
Hi Greg, I have about 40 time series each of which I have to run a seperate MLE on. I will be experimenting with different starting values for the parameters etc, so some way to automate the process will be useful. I think I can just about do this part (if you see the code above) but as I ca

[R] Using lm() combined with sapply

2011-05-31 Thread Caio Ramos Casimiro
Dear list, I spent a lot of time looking for the solution for this problem, but with no success. It's the first time I came to the list to ask for help, so I'm sorry if I break some protocol. Well, I'm trying to make a serie of regressions in different periods, actually, in growing periods. In ot

[R] Odp: Three sigma rule

2011-05-31 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.05.2011 20:12:33: > "Salil Sharma" > Odeslal: r-help-boun...@r-project.org > Dear Sir, > > > > I have data, coming from tests, consisting of 300 values. Is there a way in > R with which I can confirm this data to 68-95-99.8 rule or three-sigma

Re: [R] Compiling C-code in Windows

2011-05-31 Thread Duncan Murdoch
On 31/05/2011 7:50 AM, Tom Osborn wrote: You could use cygwin's cc/gcc, or the Watcom opensource compiler. Neither of those is supported. Use what the R Admin manual suggests, or you're on your own. Duncan Murdoch [Watcom used to be a commercial compiler which ceased and has become an ope

Re: [R] Reading Data from mle into excel?

2011-05-31 Thread Greg Snow
The sink function will write to a file what normally shows up on the screen after running some code. So while it is possible to use it to capture the output of the mle command and read the results into excel, I don't see anything useful that you could then do with it in excel. If you can tell

Re: [R] predictive accuracy

2011-05-31 Thread Marc Schwartz
Ahmed, I agree with your final statement, regarding the competency of contributors to the R lists. That has been my experience over a 10+ year time frame. That being said, you are really seeking conceptual assistance regarding your particular problem, which is not R specific, albeit, you may re

Re: [R] Metafor: Differences between two categories of a moderator

2011-05-31 Thread Viechtbauer Wolfgang (STAT)
Dear Holger, Actually, the omnibus test ("QM-test") will give you the same result regardless of which category you make the reference category (try it out!). So, it will pick up all of the differences, whether they are to the reference category or between any of the other categories. If the om

Re: [R] newbie xml parsing question

2011-05-31 Thread Upton, Stephen (Steve) (CIV)
?getNodeSet may help steve -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of eric Sent: Saturday, May 28, 2011 5:03 PM To: r-help@r-project.org Subject: [R] newbie xml parsing question I am trying to read some data off the zillow sit

Re: [R] creating a vector from a file

2011-05-31 Thread David Winsemius
On May 31, 2011, at 10:38 AM, David Winsemius wrote: On May 31, 2011, at 10:19 AM, heimat los wrote: On Tue, May 31, 2011 at 4:12 PM, Matt Shotwell wrote: On Tue, 2011-05-31 at 15:36 +0200, heimat los wrote: Hello all, I am new to R and my question should be trivial. I need to create

[R] Please HELP

2011-05-31 Thread mustafabinar
Hi R people.   I have a problem. What can I create by using functions the combinations of distances in multiple comparisons tests such as duncan multiple range test?   cur=sample(rnorm(15),15,replace=TRUE) varr=factor(c(rep("var1",5),rep("var2",5),rep("var3",5))) dat<-data.frame(cur, varr) lmm<-lm(

Re: [R] Reading Data from mle into excel?

2011-05-31 Thread Bazman76
Can I use sink() to transfer the MLE results which are a S4 type object to a text file? Can someone show me how to do this? -- View this message in context: http://r.789695.n4.nabble.com/Reading-Data-from-mle-into-excel-tp3545569p3563385.html Sent from the R help mailing list archive at Nabble.

Re: [R] Value of 'pi'

2011-05-31 Thread Ravi Varadhan
It is the same thing (simply multiply the polynomial by the LCM and you have a polynomial with integer coefficients). --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins

Re: [R] Value of 'pi'

2011-05-31 Thread JLucke
A transcendental number is not the zero of any polynomial with , not just integer, coefficients . Ravi Varadhan Sent by: r-help-boun...@r-project.org 05/31/2011 10:12 AM To "'Bentley Coffey'" , Vincy Pyne cc "r-help@r-project.org" Subject Re: [R] Value of 'pi' `pi' is more than irr

Re: [R] where two matrices differ?

2011-05-31 Thread Jonathan Daily
Does this work for you? which(is.nan(mat1 %% mat2), arr.ind = T) On Tue, May 31, 2011 at 10:52 AM, Alaios wrote: > Thanks alot. > Unfortunately I can not apply this to much bigger matrices as I can not > visually check all the components. > > Regards > Alex > > --- On Tue, 5/31/11, Scott Chambe

Re: [R] Value of 'pi'

2011-05-31 Thread Bert Gunter
and proof of irrationality is not hard (Wikipedia has several), although certainly nontrivial. Proof that it's transcendental is, requiring e.g. abstract algebra (Lindemann-Weierstrass theorem). Cheers, Bert On Tue, May 31, 2011 at 7:12 AM, Ravi Varadhan wrote: > `pi' is more than irrationa

Re: [R] where two matrices differ?

2011-05-31 Thread Marc Schwartz
Try this: mat1 <- matrix(c(1,2,1,2), 2, 2) mat2 <- matrix(c(0,0,1,2), 2, 2) > mat1 [,1] [,2] [1,]11 [2,]22 > mat2 [,1] [,2] [1,]01 [2,]02 > mat1 == mat2 [,1] [,2] [1,] FALSE TRUE [2,] FALSE TRUE # Get the indices of the elements that are not eq

Re: [R] where two matrices differ?

2011-05-31 Thread Alaios
Thanks alot. Unfortunately I can not apply this to much bigger matrices as I can not visually check all the components. Regards Alex --- On Tue, 5/31/11, Scott Chamberlain wrote: From: Scott Chamberlain Subject: Re: [R] where two matrices differ? To: "Alaios" Cc: R-help@r-project.org Date: T

Re: [R] creating a vector from a file

2011-05-31 Thread Matt Shotwell
On Tue, 2011-05-31 at 16:19 +0200, heimat los wrote: > On Tue, May 31, 2011 at 4:12 PM, Matt Shotwell > wrote: > On Tue, 2011-05-31 at 15:36 +0200, heimat los wrote: > > Hello all, > > I am new to R and my question should be trivial. I need to > create a word >

[R] reshape::cast: invalid 'yinds' argument

2011-05-31 Thread Albert-Jan Roskam
Hi, I'm using reshape to cast molten data. When I use the following command, R either crashes (when I use Notepad++) or gives an error (when I use Rgui or source()), BUT the error occurs not always, maybe only on half the attempts: w <- cast(v, id + code + productname + year + begin + end + spec

Re: [R] predictive accuracy

2011-05-31 Thread El-Tahtawy, Ahmed
1- I used R packages (design, lasso) to develop and validate prognostic models. I could have enclosed optimism from the model with and without the strong irrelevant predictor, but that will make the message very long (against guidelines for the site). 2- This issue is challenging and

Re: [R] creating a vector from a file

2011-05-31 Thread Jonathan Daily
So you need to read a file into R in that format? Try changing the values in ?read.table. Using the example, I was able to get the data using: read.table("clipboard", sep = "=", header = F, colClasses = c("character", "numeric")) On Tue, May 31, 2011 at 10:19 AM, heimat los wrote: > On Tue, Ma

Re: [R] creating a vector from a file

2011-05-31 Thread David Winsemius
On May 31, 2011, at 10:19 AM, heimat los wrote: On Tue, May 31, 2011 at 4:12 PM, Matt Shotwell wrote: On Tue, 2011-05-31 at 15:36 +0200, heimat los wrote: Hello all, I am new to R and my question should be trivial. I need to create a word cloud from a txt file containing the words and t

Re: [R] lambda, uncertainty coefficient (& Somers D)

2011-05-31 Thread Marc Schwartz
On May 31, 2011, at 8:58 AM, David Winsemius wrote: > > On May 31, 2011, at 6:18 AM, Nora M wrote: > >> Dear Marc Schwartz, >> >> I would also like to request the R code for doing this nominal measure of >> association analyses (if you dont mind..) > > You should learn to search: > > RSiteSe

Re: [R] creating a vector from a file

2011-05-31 Thread heimat los
On Tue, May 31, 2011 at 4:12 PM, Matt Shotwell wrote: > On Tue, 2011-05-31 at 15:36 +0200, heimat los wrote: > > Hello all, > > I am new to R and my question should be trivial. I need to create a word > > cloud from a txt file containing the words and their occurrence number. > For > > that purpo

Re: [R] creating a vector from a file

2011-05-31 Thread Matt Shotwell
On Tue, 2011-05-31 at 15:36 +0200, heimat los wrote: > Hello all, > I am new to R and my question should be trivial. I need to create a word > cloud from a txt file containing the words and their occurrence number. For > that purposes I am using the snippets package [1]. > As it can be seen at the

Re: [R] Value of 'pi'

2011-05-31 Thread Ravi Varadhan
`pi' is more than irrational - it is transcendental, which mean it cannot be the zero of a polynomial with integer coefficient. All transcendentals are irrationals, but not vice-versa. I have also heard (courtesy: John Nash) that `pi' is the ratio of actual time it takes to complete your thesi

Re: [R] how to store object without loosing their class property

2011-05-31 Thread Immanuel B
great! thanks 2011/5/31 Kenn Konstabel : > use "list" instead of "c": > > models <- list(model,model) > sapply(models, class) > > #      [,1]          [,2] > # [1,] "svm.formula" "svm.formula" > # [2,] "svm"         "svm" > > For understanding what c does in your case: > > c(list(first=1, second=2

Re: [R] how to define PKG_CONFIG_PATH ?

2011-05-31 Thread Prof Brian Ripley
On Tue, 31 May 2011, Wolfgang RAFFELSBERGER wrote: Dear List, as I'm trying to install R and Rgraphwiz on a Fedora Linux, I have a problem with the environement variable "PKG_CONFIG_PATH". The library "libgvc" is not getting recognized / found, although a recent version libgvc is on the sys

Re: [R] lambda, uncertainty coefficient (& Somers D)

2011-05-31 Thread David Winsemius
On May 31, 2011, at 6:18 AM, Nora M wrote: Dear Marc Schwartz, I would also like to request the R code for doing this nominal measure of association analyses (if you dont mind..) You should learn to search: RSiteSearch is a function that you can use at the R command line RSiteSearch("So

  1   2   >