[R] Problem about step and stepAIC

2011-04-27 Thread Maggie Wong
Hello, I am now running a multiple linear regression program, but I do not know the difference between the command step and stepAIC. Thanks. Maggie [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Barplot for degree distribution

2011-04-27 Thread kparamas
Thanks for the info. I have 2 degree distributions that have different degrees. I want both these barplots to have the same axes. Is this possible? I have used xlim and ylim. ylim works fine for both plots But xlim I am not getting the values till 60. And if I give names(dd) - 0:60 it gives an

[R] matrix of higher order differences

2011-04-27 Thread Jeroen Ooms
Is there an easy way to turn a vector of length n into an n by n matrix, in which the diagonal equals the vector, the first off diagonal equals the first order differences, the second... etc. I.e. to do this more efficiently: diffmatrix - function(x){ n - length(x); M - diag(x);

Re: [R] Random Normal Variable Correlated to an Existing BinomialVariable

2011-04-27 Thread Enrico Schumann
Hi, do you know the parameters of the binomial variate? then maybe you could use something like the code below. as Petr pointed out, it is generally not guaranteed that you can create variates with any linear correlation (ie, depending on the parameters of the binomial) n - 100# how many

Re: [R] Problems saving an Object called by get

2011-04-27 Thread Ivan Calandra
Hi, Not sure it is exactly what you're looking for, but it might help you: save(PortafolioInicial, ...) ## you just save the original object instead of the assign()ed one. But when you load() it, you have to know its name, so it might be difficult to use. Even better (for me at least), is

[R] Empty Data Frame

2011-04-27 Thread Santosh Srinivas
Dear Group, Is there a more efficient way to create a data frame structure (using rep I guess?) require(plyr) week - rdply(10, data.frame(week = 1:52)) names(week) - c(Year, Week) week$Year - week$Year + 2000 Basically trying to create a year and week data frame to start appending data to for

Re: [R] separate and arrange outputs

2011-04-27 Thread ivan
Hi, thank you very much. On Tue, Apr 26, 2011 at 10:06 PM, Jerome Asselin jerome.asselin.s...@gmail.com wrote: On Tue, 2011-04-26 at 19:46 +0200, ivan wrote: Hello, given that a self made function produces multiple outputs, is there a possibility to separate latter by stars or simply

Re: [R] logistic regression: wls and unbalanced samples

2011-04-27 Thread peter dalgaard
On Apr 27, 2011, at 00:22 , Andre Guimaraes wrote: Greetings from Rio de Janeiro, Brazil. I am looking for advice / references on binary logistic regression with weighted least squares (using lrm weights), on the following context: 1) unbalanced sample (n0=1, n1=700); 2) sampling

Re: [R] Undestanding return()

2011-04-27 Thread Uwe Ligges
On 26.04.2011 23:08, jim holtman wrote: As soon as you execute the 'return' , the value is returned. Right, and nothing else will be evaluated after the first return() was evaluated. Uwe Ligges What you did not show is did the code have if-then-else to go down separate paths. On

Re: [R] Lattice nb/wlist help

2011-04-27 Thread Gary Nobles
hi I am still tryingto do this, I have been working on this for a year but i have remained stuck... I have points at regular intervals but within an irregular window I need to make a nb weights matrix, then nb2wlist conceptually a D8 neighbourhood something like this: 000 000 0011100

[R] Assignments inside lapply

2011-04-27 Thread Alaios
Dear all I would like to ask you if an assignment can be done inside a lapply statement. For example I would like to covert a double nested for loop for (i in c(1:dimx)){ for (j in c(1:dimy)){ Powermap[i,j] - Pr(c(i,j),c(PRX,PRY),f) } } to something like that:

Re: [R] Empty Data Frame

2011-04-27 Thread Dennis Murphy
Hi: You could try something like df - data.frame( expand.grid( Week = 1:52, Year = 2002:2011 )) dim(df) head(df) The first variable changes faster than the second. HTH, Dennis On Wed, Apr 27, 2011 at 1:03 AM, Santosh Srinivas santosh.srini...@gmail.com wrote: Dear Group, Is there a more

Re: [R] Assignments inside lapply

2011-04-27 Thread lcn
unlist(lapply(1:nrow(ij),function(rowId) { return (Powermap[i,j]-Pr(c(ij$i[rowId],ij$j[rowId]),c(PRX,PRY),f)) }))lapply actually catches each return value of the excuted function. here your function actually returns nothing if the assignment succeeds. If your purpose for the call to Pr is

Re: [R] Assignments inside lapply

2011-04-27 Thread Nick Sabbe
No, that does not work. You cannot do assignment within (l)apply. Nor in any other function for that matter. Nick Sabbe -- ping: nick.sa...@ugent.be link: http://biomath.ugent.be wink: A1.056, Coupure Links 653, 9000 Gent ring: 09/264.59.36 -- Do Not Disapprove -Original Message-

Re: [R] Assignments inside lapply

2011-04-27 Thread Kenn Konstabel
On Wed, Apr 27, 2011 at 12:58 PM, Nick Sabbe nick.sa...@ugent.be wrote: No, that does not work. You cannot do assignment within (l)apply. Nor in any other function for that matter. Yes that may work if you want to. You can do non-local assignment within lapply using - (and, for that matter,

Re: [R] Problem about step and stepAIC

2011-04-27 Thread Prof Brian Ripley
On Wed, 27 Apr 2011, Maggie Wong wrote: Hello, I am now running a multiple linear regression program, but I do not know the difference between the command step and stepAIC. And what is the 'problem about step and stepAIC'? You can find out by reading the help, as the posting guide asked

Re: [R] Assignments inside lapply

2011-04-27 Thread ONKELINX, Thierry
Dear Alex, I think you want to use apply() ij - expand.grid(i = seq_len(dimx),j = seq_len(dimy)) Powermap - apply(ij, 1, function(x){ Pr(x, c(PRX, PRY), f) }) Best regards, Thierry ir. Thierry Onkelinx

Re: [R] Assignments inside lapply

2011-04-27 Thread Alaios
I would like to use lapply as there is a parallel version of lapply called mclapply. My purpose is to convert for (i in c(1:dimx)){ for (j in c(1:dimy)){ Powermap[i,j] - Pr(c(i,j),c(PRX,PRY),f) }} to something that can run in parallel with mclapply: I am not sure then how to store

Re: [R] logistic regression: wls and unbalanced samples

2011-04-27 Thread Prof Brian Ripley
On Wed, 27 Apr 2011, peter dalgaard wrote: On Apr 27, 2011, at 00:22 , Andre Guimaraes wrote: Greetings from Rio de Janeiro, Brazil. I am looking for advice / references on binary logistic regression with weighted least squares (using lrm weights), on the following context: 1) unbalanced

Re: [R] Assignments inside lapply

2011-04-27 Thread ONKELINX, Thierry
Here is a solution with lapply PowerMatrix - matrix(unlist(lapply(seq_len(dimx*dimy), function(x){ i - 1 + (x - 1) %% dimx j - 1 + (x - 1) %/% dimy Pr(c(i,j),c(PRX,PRY),f) })), nrow = dimx) A reproducible example dimx - 5 dimy - 6 PowerMatrix -

[R] Kruskal.test

2011-04-27 Thread Allan Buras
Hello, I've got a question concerning kruskal.test: Is there any post-hoc test for kruskal.test like there is one for aov (TukeyHSD) and is it possible to plot this post-hoc test (if available). I need to find out, which of my sample-groups differ significantly from each other... If not, is

Re: [R] graphics: 3D regression plane

2011-04-27 Thread agent dunham
Dear community, Thanks for regr2.plot. I've another question. When fixing OLS I used training data and test data. I'd like to know if it's possible to draw the plane I've fixed with the training data, and draw the observed and predicted points achieved with the test data. If so any help or

[R] Fitting gamma and exponential Distributions with fitdist

2011-04-27 Thread vioravis
I am trying to fit gamma and exponential distributions using fitdist function in the fitdistrplus package to the data I have and obtain the parameters along with the AIC values of the fit. However, I am getting errors with both distributions. I have given an reproducible example with the errors I

[R] Speed up plotting to MSWindows graphics window

2011-04-27 Thread Jonathan Gabris
Hello, I am working on a project analysing the performance of motor-vehicles through messages logged over a CAN bus. I am using R 2.12 on Windows XP and 7 I am currently plotting the data in R, overlaying 5 or more plots of data, logged at 1kHz, (using plot.ts() and par(new = TRUE)). The

Re: [R] graphics: 3D regression plane

2011-04-27 Thread agent dunham
Hi, thanks, I think I've changed the previous as you told me but I'm having this error, what does it mean? model- lm(log(v1)~log(v2)+v3, data=dat) newax- expand.grid( v2 = seq(min(log(dat$v2)), max(log(dat$v2)), length=100), v3= seq(min(dat$v3), max(dat$v3), length=100)) fit -

[R] Instances of a C++ class in R

2011-04-27 Thread soeren . vogel
Hello We are working on a class in C++. The files compile fine (R CMD SHLIB ...) and run in R. A bzipped tar archive with source code can be downloaded from here: http://sovo.md-hh.com/files/GUTS3.tar.bz In R, dyn.load(GUTS.so) generates an instance of the GUTS class. (How) Is it possible to

[R] multiple comparisons on a between factor

2011-04-27 Thread elgoran
Dear list, im facing an issue of statistical data analysis that I consider myself unable to resolve in R so i hope to get some valuable insights from you. i run an ANOVA with four factors; factor4 is an between factor (two different groups measured), the others are withins (tested

Re: [R] Using Java methods in R

2011-04-27 Thread lcn
I guess your failure of getting two dimensional array may be related to this : http://www.rforge.net/rJava/news.html 0.9-0 (under development) o fixes issues introduced by several new features in the late 0.8 series. Most imporantly .jarray() and .jevalArray() behave as

Re: [R] Problems saving an Object called by get

2011-04-27 Thread Duncan Murdoch
Luis Felipe Parra wrote: Sorry David, I understand what you mean but could you help with how it would be done more specifically. Use save(list=paste(Algoritmo, _Portafolio, sep=), ... ) Duncan Murdoch Thanks On Wed, Apr 27, 2011 at 11:27 AM, David Winsemius dwinsem...@comcast.netwrote:

Re: [R] Generalized Linear Model

2011-04-27 Thread Thomas Levine
Because you have two dependent variables, you'll want to to use a multivariate logit. mlogit does this, but I don't know the syntax off hand. If you just wanted to look at one dependent variable, it would be the following (which Alex said) glm(y~x1*x2,family='binomial') On Mon, Apr 25, 2011 at

Re: [R] Speed up plotting to MSWindows graphics window

2011-04-27 Thread Duncan Murdoch
Jonathan Gabris wrote: Hello, I am working on a project analysing the performance of motor-vehicles through messages logged over a CAN bus. I am using R 2.12 on Windows XP and 7 I am currently plotting the data in R, overlaying 5 or more plots of data, logged at 1kHz, (using plot.ts() and

[R] fast way to compare two matrices

2011-04-27 Thread Alaios
Dear all, I am trying to speed up some code and I would like to check fast that it works by comparing two different matrices. What is the fastest way to do that in R? Best Regards Alex __ R-help@r-project.org mailing list

[R] Odp: fast way to compare two matrices

2011-04-27 Thread Petr PIKAL
Hi x - matrix(rnorm(1e6), 1000,1000) y - matrix(rnorm(1e6), 1000,1000) identical(x,y) [1] FALSE The response is almost instant. In case you are not satisfied with the unspecific answer be more specific with your question. Regards Petr r-help-boun...@r-project.org napsal dne 27.04.2011

Re: [R] Speed up plotting to MSWindows graphics window

2011-04-27 Thread Mike Marchywka
Date: Wed, 27 Apr 2011 11:16:26 +0200 From: jonat...@k-m-p.nl To: r-help@r-project.org Subject: [R] Speed up plotting to MSWindows graphics window Hello, I am working on a project analysing the performance of motor-vehicles through messages logged over a CAN bus. I am using R 2.12 on

Re: [R] Using Java methods in R

2011-04-27 Thread hill0093
Thanks Icn for the lookup. I appreciate your skill. The static double field con0dbl started working for me too. I was surprised, and checked my code carefully. I think they corrected that in rJava. I download and install rJava each time I use R. Hill -- View this message in context:

Re: [R] matrix of higher order differences

2011-04-27 Thread Hans W Borchers
Jeroen Ooms jeroenooms at gmail.com writes: Is there an easy way to turn a vector of length n into an n by n matrix, in which the diagonal equals the vector, the first off diagonal equals the first order differences, the second... etc. I.e. to do this more efficiently: diffmatrix -

Re: [R] Odp: fast way to compare two matrices

2011-04-27 Thread Alaios
That was great :) REgards --- On Wed, 4/27/11, Petr PIKAL petr.pi...@precheza.cz wrote: From: Petr PIKAL petr.pi...@precheza.cz Subject: Odp: [R] fast way to compare two matrices To: Alaios ala...@yahoo.com Cc: R-help@r-project.org, r-help-boun...@r-project.org Date: Wednesday, April 27,

Re: [R] Speed up plotting to MSWindows graphics window

2011-04-27 Thread Uwe Ligges
On 27.04.2011 12:56, Duncan Murdoch wrote: Jonathan Gabris wrote: Hello, I am working on a project analysing the performance of motor-vehicles through messages logged over a CAN bus. I am using R 2.12 on Windows XP and 7 I am currently plotting the data in R, overlaying 5 or more plots of

[R] calculations with vectors of unequal length

2011-04-27 Thread E Hofstadler
Hi there, this is probably simple but I can't seem to figure it out by myself... I have two dataframes (df.1 and df.2): df.1 - data.frame(year=factor(rep(1:3,3)), level=rep(letters[1:3],3), number=c(11:19)) df.2 - data.frame(year=factor(c(1:5)), number=c(21:25)) I would like to create a new

Re: [R] calculations with vectors of unequal length

2011-04-27 Thread Scott Chamberlain
df.1 - merge(df.1, df.2, by = year) df.1$sum - df.1$number.x + df.1$number.y df.1 year level number.x number.y sum 1 1 a 11 21 32 2 1 a 17 21 38 3 1 a 14 21 35 4 2 b 12 22 34 5 2 b 15 22 37 6 2 b 18 22 40 7 3 c 16 23 39 8 3 c 13 23 36 9 3 c 19 23 42 Scott On Wednesday, April 27, 2011

[R] Eval to write many files

2011-04-27 Thread Alaios
Dear all I am looking for a shorter way and more elegant to write the following for (i in c(1:length(Shadowlist))){ filename-paste('/home/apa/maps/',model,i,'.mat',sep=) varname-paste(model,'_shadow',i,sep=) eval(parse(text=paste('writeMat(filename,',varname,'=Shadowlist[[i]])',sep=))) }

[R] Odp: calculations with vectors of unequal length

2011-04-27 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 27.04.2011 13:30:13: Hi there, this is probably simple but I can't seem to figure it out by myself... I have two dataframes (df.1 and df.2): df.1 - data.frame(year=factor(rep(1:3,3)), level=rep(letters[1:3],3), number=c(11:19)) df.2 -

Re: [R] About snow packages

2011-04-27 Thread Uwe Ligges
On 26.04.2011 21:06, Truc Nguyen Trung wrote: Dear Luke ! This is not Luke but the R-help mailing list. In case you want to contact Luke Tierney: He has its own mail address. Thanh you for the lovely packages. I have used it, it woks fine for Linux, XP, but concerning about windows 7 -

[R] read.table: fill=T for header?

2011-04-27 Thread Philipp Pagel
Dear ExpeRts,t I am trying to read tab delimted data produced by somewhat brain dead software that seems to think it's a good idea to have an extra tab character after the last column - except for the header line. As explained in the help page, read.delim now assumes that the first

Re: [R] calculations with vectors of unequal length

2011-04-27 Thread E Hofstadler
Great, many thanks to Scott and Petr! 2011/4/27 Petr PIKAL petr.pi...@precheza.cz: Hi r-help-boun...@r-project.org napsal dne 27.04.2011 13:30:13: Hi there, this is probably simple but I can't seem to figure it out by myself... I have two dataframes (df.1 and df.2): df.1 -

Re: [R] Eval to write many files

2011-04-27 Thread Uwe Ligges
On 27.04.2011 13:59, Alaios wrote: Dear all I am looking for a shorter way and more elegant to write the following for (i in c(1:length(Shadowlist))){ filename-paste('/home/apa/maps/',model,i,'.mat',sep=) varname-paste(model,'_shadow',i,sep=)

[R] Odp: read.table: fill=T for header?

2011-04-27 Thread Petr PIKAL
Hi If I understand correctly you maybe could read a file without header, discard last column, read first line of a file and put it as column names. read.delim(textConnection(infile), header=F, skip=1) scan(textConnection(infile), nlines=1, sep=\t, what=c(,)) Regards Petr

[R] Turning a vector into a matrix based on a matrix of vector indices

2011-04-27 Thread Barth B. Riley
Hello I have a matrix (though it could also be a ragged array) called items.used, that has the item numbers of questions administered to a set of respondents. I also have a vector of item parameters called b[]. I am looking for an elegant way to create a matrix b.mat in which each element is

[R] quantmod: Error in charToDate(x)

2011-04-27 Thread Swen Strek
Hi, I have following problem when trying to feed an CSV file to quantmod using following command: getSymbols(test1,src=csv) Error in charToDate(x) : character string is not in a standard unambiguous format The sample test1.csv file contents: Symbol, Date, Open, High, Low, Close, Volume

[R] lattice wireframe with logarithmically scaled axis?

2011-04-27 Thread Dr. Meesters, Christian
Hi, I have some questions for the wireframe function of the lattice package. My dataset's x-data are sampled logarithmically and as such I would like to have a semilogarithmic 3D plot when plotting a time series. Does anyone know how to change the example in

[R] arch=i386

2011-04-27 Thread Stat Consult
Dear ALL I want to load HTSanalyzeR, It 's necessary to load igraph package. This time I see this error: library(igraph) library(HTSanalyzeR) Loading required package: GSEABase Loading required package: Biobase Error: package 'Biobase' is not installed for 'arch=i386' I 'll be glade if you

Re: [R] calculations with vectors of unequal length

2011-04-27 Thread Jeremy Hetzel
See ?merge. df.1 - data.frame(year=factor(rep(1:3,3)), level=rep(letters[1:3],3), number=c(11:19)) df.2 - data.frame(year=factor(c(1:5)), number=c(21:25)) df.3 - merge(df.1, df.2, by = year) df.3$new - with(df.3, number.x + number.y) Jeremy On Wednesday, April 27, 2011 7:30:13 AM UTC-4, E

Re: [R] Speed up plotting to MSWindows graphics window

2011-04-27 Thread Jonathan Gabris
On 27/04/2011 13:18, Mike Marchywka wrote: Date: Wed, 27 Apr 2011 11:16:26 +0200 From:jonat...@k-m-p.nl To:r-help@r-project.org Subject: [R] Speed up plotting to MSWindows graphics window Hello, I am working on a project analysing the performance of motor-vehicles

[R] str() without any details - only structure? (removing elements from list)

2011-04-27 Thread Oliver
Hello, can I get somehow the pure structure without any details via str or other functions? I have a very large list with lists as elements... And now I want to know which structure I have, becaiuse I need to kick out some entries. Any idea? Oliver

Re: [R] sub-matrix block size

2011-04-27 Thread David Winsemius
On Apr 27, 2011, at 12:07 AM, Dennis Murphy wrote: Hi: Maybe this can help get you started. Reading your data into a matrix m, m - structure(c(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,

Re: [R] Barplot for degree distribution

2011-04-27 Thread David Winsemius
On Apr 27, 2011, at 12:00 AM, kparamas wrote: Thanks for the info. I have 2 degree distributions that have different degrees. Do you mean a different range of values? I want both these barplots to have the same axes. Is this possible? I have used xlim and ylim. ylim works fine for both

Re: [R] arch=i386

2011-04-27 Thread Uwe Ligges
On 27.04.2011 13:46, Stat Consult wrote: Dear ALL I want to load HTSanalyzeR, It 's necessary to load igraph package. This time I see this error: library(igraph) library(HTSanalyzeR) Loading required package: GSEABase Loading required package: Biobase Error: package 'Biobase' is not

Re: [R] arch=i386

2011-04-27 Thread Uwe Ligges
Grr, and 1) do not cross post to several lists (as the posting guide says)! 2) what is your name, Stat Consult? Don't you feel the name Stat Consult somewhat ridiculous when asking such elementary question that could have been sorted out if you had read the posting guide and the manuals?

[R] setting options only inside functions

2011-04-27 Thread Jannis
Dear list members, is it possible to set some options only inside a function so that the original options are restored once the function is finished or aborted due to an error? Until now I do something like: dummy=function() { old.options=options(error=dummy1())

Re: [R] setting options only inside functions

2011-04-27 Thread Jeremy Hetzel
See ?on.exit Jeremy On Wednesday, April 27, 2011 9:16:13 AM UTC-4, Jannis wrote: Dear list members, is it possible to set some options only inside a function so that the original options are restored once the function is finished or aborted due to an error? Until now I do something

Re: [R] setting options only inside functions

2011-04-27 Thread Uwe Ligges
On 27.04.2011 15:16, Jannis wrote: Dear list members, is it possible to set some options only inside a function so that the original options are restored once the function is finished or aborted due to an error? Until now I do something like: dummy=function() {

Re: [R] How can I extract information from list which class is nls

2011-04-27 Thread Schatzi
Here is more information on the equation. It is a growth function: Growth = a + b*(1-exp(-k*time)) where a, b and k are parameters. I wanted to test the difference in total growth between treatments and the parameters a + b represent total growth. Thus, I figured that I could add the

Re: [R] setting options only inside functions

2011-04-27 Thread Jonathan Daily
There is probably a more elegant way to do this, but you could write it into dummy1(): dummy1 - function() { ...original function options(old.options) } Alternatively, you could use ?tryCatch with the finally argument as a call to options. HTH, Jon On Wed, Apr 27, 2011 at 9:16 AM, Jannis

Re: [R] Lattice nb/wlist help

2011-04-27 Thread David Winsemius
On Apr 27, 2011, at 5:28 AM, Gary Nobles wrote: hi I am still tryingto do this, I have been working on this for a year but i have remained stuck... I have points at regular intervals but within an irregular window I need to make a nb weights matrix, then nb2wlist Not sure I understand

Re: [R] sub-matrix block size

2011-04-27 Thread Santosh
Thanks, David! That is another interesting perspective to (sub/super) diagonal story! For now I was looking only at block sizes of lower triangle submatrices as Dennis suggested. Regards, Santosh On Wed, Apr 27, 2011 at 5:57 AM, David Winsemius dwinsem...@comcast.netwrote: On Apr 27, 2011, at

Re: [R] matrix of higher order differences

2011-04-27 Thread David Winsemius
On Apr 27, 2011, at 7:25 AM, Hans W Borchers wrote: Jeroen Ooms jeroenooms at gmail.com writes: Is there an easy way to turn a vector of length n into an n by n matrix, in which the diagonal equals the vector, the first off diagonal equals the first order differences, the second...

[R] AUTO: Hans-Peter Hafner Dr./HSL/DE ist außer Haus.

2011-04-27 Thread hhafner
Ich bin bis 02.05.2011 abwesend. Ihre Mail wird nicht weitergeleitet. Ich beantworte sie nach meiner Rückkehr. In dringenden Fällen schreiben Sie bitte an forschungsdatenzent...@statistik-hessen.de . Hinweis: Dies ist eine automatische Antwort auf Ihre Nachricht R-help Digest, Vol 98,

Re: [R] lattice wireframe with logarithmically scaled axis?

2011-04-27 Thread David Winsemius
On Apr 27, 2011, at 6:49 AM, Dr. Meesters, Christian wrote: Hi, I have some questions for the wireframe function of the lattice package. My dataset's x-data are sampled logarithmically and as such I would like to have a semilogarithmic 3D plot when plotting a time series. Does anyone

Re: [R] How can I extract information from list which class is nls

2011-04-27 Thread David Winsemius
On Apr 27, 2011, at 9:28 AM, Schatzi wrote: Here is more information on the equation. It is a growth function: Growth = a + b*(1-exp(-k*time)) where a, b and k are parameters. I wanted to test the difference in total growth between treatments and the parameters a + b represent total

Re: [R] Predicting with a principal component regression model: non-conformable arguments error

2011-04-27 Thread Alison Callahan
Hi Dennis, My replies are in-line. On Tue, Apr 26, 2011 at 9:15 PM, Dennis Murphy djmu...@gmail.com wrote: Hi: My view, which may well be narrow, is that techniques like PLS and PCR are useful fit procedures, but I would be very leery about using them as prediction machines. With new data,

Re: [R] logistic regression: wls and unbalanced samples

2011-04-27 Thread Andre Guimaraes
Many thanks for your messages. I will take a look at the survey package. I was concerned with the issues raised by Cramer (1999) in Predictive performance of the binary logit model in unbalanced samples. In this particular case, misclassification costs are much higher for the smaller group

[R] msvcr80.dll is missing

2011-04-27 Thread Fang, Yongxiang
Dear All, I run R on a windows 7 machine and it has been worked very well. I installed Graphvis 2.20.3 and Rgraphviz. recently, however, I cannot load the Rgraphviz package and error message popped up The message shown on the pop up window with the title: R Consol: Rgui.exe - Sysytem error

Re: [R] Empty Data Frame

2011-04-27 Thread Hadley Wickham
On Wed, Apr 27, 2011 at 4:58 AM, Dennis Murphy djmu...@gmail.com wrote: Hi: You could try something like df - data.frame( expand.grid( Week = 1:52, Year = 2002:2011 )) expand.grid already returns a data frame... You might want KEEP.OUT.ATTRS = F though. Even it feels like you are yelling

[R] Attempting to access an R list from within C code

2011-04-27 Thread Cormac Long
Hello R-help, I am wondering if anyone can help me with this: I want to access data in a list which has been passed into a C function, but I cannot work out how to access the values. How do I move from the given SEXP pointer to the next object in the list? I have tried to use CDR, but to no

Re: [R] Speed up plotting to MSWindows graphics window

2011-04-27 Thread Mike Marchywka
Date: Wed, 27 Apr 2011 14:40:23 +0200 From: jonat...@k-m-p.nl To: r-help@r-project.org Subject: Re: [R] Speed up plotting to MSWindows graphics window On 27/04/2011 13:18, Mike Marchywka wrote: Date: Wed, 27 Apr 2011 11:16:26 +0200

Re: [R] Odp: fast way to compare two matrices

2011-04-27 Thread peter dalgaard
On Apr 27, 2011, at 13:29 , Alaios wrote: That was great :) REgards You may need to turn your sarcasm detector back on. Beware: x - matrix(rnorm(1e6), 1000,1000) y - solve(solve(x)) identical(x,y) [1] FALSE all.equal(x,y) [1] TRUE summary(c(x-y)) Min.1st Qu. Median

Re: [R] Help

2011-04-27 Thread петрович
Thanks a lot Jim, Dennis. Jim, actually where dots were I meant etcetera or similar data. ;) My output is close to that one Dennis proposed with function aggregate, but i would like to keep the column var2 and the rest of columns with the unique value corresponding to var1 greatest value, So

Re: [R] How can I extract information from list which class is nls

2011-04-27 Thread Schatzi
It is not a human growth curve. The parameter estimates are about: a = .5 b = 7 k = 1 It is not a sigmoidal curve as there is never a concave segment. From: ml-node+3478241-1447170361-211...@n4.nabble.com [mailto:ml-node+3478241-1447170361-211...@n4.nabble.com] Sent: Wednesday, April 27, 2011

Re: [R] multiple comparisons on a between factor

2011-04-27 Thread Richard M. Heiberger
Lisa, Please look at some of the demos in the HH package. These are built on the capabilities of the glht function in the multcomp package. ## install.packages(HH) ## if necessary library(HH) demo(MMC.WoodEnergy-aov, package=HH) ## first demo(MMC.WoodEnergy, package=HH) ## second Rich On

Re: [R] Attempting to access an R list from within C code

2011-04-27 Thread Duncan Murdoch
On 27/04/2011 9:43 AM, Cormac Long wrote: Hello R-help, I am wondering if anyone can help me with this: I want to access data in a list which has been passed into a C function, but I cannot work out how to access the values. How do I move from the given SEXP pointer to the next object in the

[R] centroid representation and MANOVA

2011-04-27 Thread julien colomb
hi all. I have a matrix of data with 5 different groups and 20 individual response per group, and about 12 variables collected for each. I want to represent the result in a 2D plot. PCA is not so good because the difference between the groups is not obvious. I have seen, in a recent paper,

[R] paste function by INDICES

2011-04-27 Thread Massimiliano Tripoli
Dear all, I have the following R dataframe: set.seed(11) (df - data.frame(ID=rep(1:10,1:10),a=factor(sample(1:4,55,rep=T)))) where ID is an identification code. I need to create a new variable b in which I would paste the full group of a variable according to ID variable. For

Re: [R] msvcr80.dll is missing

2011-04-27 Thread Prof Brian Ripley
Please ask about Rgraphviz (and particularly binary distributions of it) on the list of those providing it (which is not R!). And do use a sensible subject line (which really does need to include 'Rgraphviz'), as the posting guide asked you to. On Wed, 27 Apr 2011, Fang, Yongxiang wrote:

Re: [R] matrix of higher order differences

2011-04-27 Thread Petr Savicky
On Wed, Apr 27, 2011 at 11:25:42AM +, Hans W Borchers wrote: Jeroen Ooms jeroenooms at gmail.com writes: Is there an easy way to turn a vector of length n into an n by n matrix, in which the diagonal equals the vector, the first off diagonal equals the first order differences, the

Re: [R] ROCR - best sensitivity/specificity tradeoff?

2011-04-27 Thread Dr. Meesters, Christian
Thanks Claudia, Meanwhile I implemented a simple function to evaluate the Youden-Index and subsequently all other parameters. This is sufficient for my purpose. Cheers, Christian __ R-help@r-project.org mailing list

Re: [R] paste function by INDICES

2011-04-27 Thread Phil Spector
Massimiliano - Here's one way, assuming you wanted b to be the same length as a: df = transform(df,b=ave(as.character(df$a),df$ID, FUN=function(a)paste(a,collapse=''))) If you just want one observation for each value of ID, you could use

Re: [R] graphics: 3D regression plane

2011-04-27 Thread Paul Johnson
Hi. Comments below On Wed, Apr 27, 2011 at 2:32 AM, agent dunham crossp...@hotmail.com wrote: Hi, thanks, I think I've changed the previous as you told me but I'm having this error, what does it mean? model- lm(log(v1)~log(v2)+v3, data=dat) newax- expand.grid(    v2 =

Re: [R] centroid representation and MANOVA

2011-04-27 Thread John Fox
Dear Julian, Though it's not exactly what you're looking for, you might take a look at the heplots package (on CRAN). I hope this helps, John John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University

[R] Question on list object

2011-04-27 Thread Bogaso Christofer
Dear all, let say, I have following list object: listObj - vector(list, length = 3) listObj[[1]] - rnorm(3) listObj[[2]] - rnorm(4) listObj[[3]] - rnorm(5) Now I want to convert above list into a Matrix. Ofcourse I can do it using Reduce(rbind, listObj). However as you notice that as

Re: [R] Question on list object

2011-04-27 Thread Jorge Ivan Velez
Hi Christofer, You might try sapply(listObj, function(l) l[1:max(sapply(listObj, length))] ) HTH, Jorge On Wed, Apr 27, 2011 at 1:23 PM, Bogaso Christofer wrote: Dear all, let say, I have following list object: listObj - vector(list, length = 3) listObj[[1]] - rnorm(3) listObj[[2]]

Re: [R] Question on list object

2011-04-27 Thread Phil Spector
Here's one way: uselen = max(sapply(listObj,length)) do.call(rbind,lapply(listObj,function(x){length(x) = uselen;x})) [,1] [,2] [,3] [,4] [,5] [1,] 0.0702225 -1.143031 1.6437560 NANA [2,] -0.6100869 2.657910 -0.6028418 -0.7739858NA

Re: [R] Using Java methods in R

2011-04-27 Thread hill0093
I don't know who to contact in the management of this R-forum, and there are a few things I cannot figure out. As I understand it, to participate and learn on the R-forum, I must receive all the emails even concerning topics I have no interest in currently. It clogs up my email, takes a long

Re: [R] Using Java methods in R

2011-04-27 Thread fjpcaballero
Absence of evidence is not evidence of absence. Perhaps you are not getting answers for a good reason. From a previous email: 1) reading the source code of packages that use rJava, such as RWeka is the best way to understand how things work. If you are asked to do so is for a reason;

Re: [R] density plot of simulated exponential distributed data

2011-04-27 Thread Greg Snow
You might want to use the logspline package instead of the density function, it allows you to specify bounds on a distribution. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

[R] glmnet package: penalty.factor option

2011-04-27 Thread Brian H. Chen
Anyone have experience specifying the penalty.factor option in the glmnet command? I have 3 variables (out of a million genotype variables) that I want to force into the model (i.e., set penalty factor to 0), but I can't figure out how to do that. [[alternative HTML version deleted]]

[R] bwlpot problems: printing, and tick labels

2011-04-27 Thread Dimitri Shvorob
Two problems with the code below. A. It produces empty JPEGs. When the 'bwplot' line alone is submitted, the plot duly shows up. B. When the 'bwplot' line alone is submitted, y labels are values 1 to 6, not actual distinct values of y$maxthreads. (C. I would, of course, prefer to produce plots

Re: [R] multiple comparisons on a between factor

2011-04-27 Thread elgoran
Rich, thanks a lot, i will definitly check it out. however, since the analysis mentioned above is already implemented could you or anyone tell me whether it contains any statistical flaws? best Lisa __ Von:

[R] Pause the execution of a function

2011-04-27 Thread Lisa
Dear all, I am trying to write a script to pause the execution of a function and provide some additional commands to the function and then continue execution of the function. For example, when my function detects a wrong number in a dataset, the function pauses automatically and returns

[R] applying uniroot function to each element in vector

2011-04-27 Thread Dale
If I have a vector of n elements, e.g. a vector of length 4 with elements 10, 20, 30, 40 and want to find the different values of x such that x^2=10, x^2=20, x^30 and x^2=40, how could I do this in R? I'm thinking of using the uniroot function, but am finding difficult applying it to a vector.

Re: [R] Question on list object

2011-04-27 Thread Henrique Dallazuanna
Try this: sapply(listObj, '[', 1:max(sapply(listObj, length))) On Wed, Apr 27, 2011 at 2:23 PM, Bogaso Christofer bogaso.christo...@gmail.com wrote: Dear all, let say, I have following list object: listObj - vector(list, length = 3) listObj[[1]] - rnorm(3) listObj[[2]] - rnorm(4)

  1   2   >