Re: [R] TukeyHSD with Type III SS

2010-12-02 Thread Dieter Menne
Ali S wrote: Is there a way to run TukeyHSD with Type III instead of Type I SS? I am sure Bill Venables will respond, but in the meantime read: http://r-project.markmail.org/search/?q=type+III+venables And search google for Venables exegesis. It's one of the unique terms. Dieter --

Re: [R] Why do I get (not estimable) in this aov data

2010-12-02 Thread Hedberg Peter
I realize the problem now, and you are right aov is wrong. It seams that it was completely wrong to use the transect in a fixed formula, since my Trasects are labeled A to P, and A to D is in one mainplot, E-H in another, I-L an a third, and M-P in a fourth. In this case lme, with random

[R] Arrange elements on a matrix according to rowSums + short 'apply' Q

2010-12-02 Thread Aaron Polhamus
Greetings, My goal is to create a Markov transition matrix (probability of moving from one state to another) with the 'highest traffic' portion of the matrix occupying the top-left section. Consider the following sample: inputData - c( c(5, 3, 1, 6, 7), c(9, 7, 3, 10, 11), c(1, 2, 3,

Re: [R] venneuler() - customize a few things

2010-12-02 Thread Francesco Lescai
Hi, I was wondering if it would be possible to print the counts of common items in the venneuler() diagrams. Anybody knows a straightforward idea? I can always count things from the data matrix, but I have vectors with 50 thousands elements. thanks Francesco --

Re: [R] Arrange elements on a matrix according to rowSums + short 'apply' Q

2010-12-02 Thread Ivan Calandra
Hi, Here is a not so easy way to do your first step, but it works: MAT2 - cbind(MAT, rowSums(MAT)) MAT[order(MAT2[,6], decreasing=TRUE),] For the second, I don't know! HTH, Ivan Le 12/2/2010 09:46, Aaron Polhamus a écrit : Greetings, My goal is to create a Markov transition matrix

[R] using foreach (parallel processing)

2010-12-02 Thread Santosh Srinivas
Hello group, I am experimenting with parallel processing on my quad core Win 7 32 bit machine. Using these packages for the first time. I can see all my processor running at full performance when I use a smaller dataset require(snow) require(doSNOW) require(foreach) #change the 8 to however

Re: [R] Arrange elements on a matrix according to rowSums + short 'apply' Q

2010-12-02 Thread Michael Bedward
Hi Aaron, Following up on Ivan's suggestion, if you want the column order to mirror the row order... mo - order(rowSums(MAT), decreasing=TRUE) MAT2 - MAT[mo, mo] Also, you don't need all those extra c() calls when creating inputData, just the outermost one. Regarding your second question, your

Re: [R] using foreach (parallel processing)

2010-12-02 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/02/2010 10:56 AM, Santosh Srinivas wrote: Hello group, Hi First of all: there is a special interest group for high performance computing in R, which includes parallel computing, wghich would be more appropriate to ask. But I will try anyway:

Re: [R] attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'

2010-12-02 Thread Karl Brand
Cheers Bill. You got me halfway, since: temp - merge(x=x, y=y[,17, drop=FALSE], by=rownames, sort=FALSE) Error in fix.by(by.x, x) : 'by' must specify valid column(s) but, using row.names instead of rownames, like: temp - merge(x=x, y=y[,17, drop=FALSE], by=row.names, sort=FALSE) works (but

[R] rpart results - problem after oversampling

2010-12-02 Thread Mederos, Vicente (Santander)
Hi all, I am trying to predict a target variable that takes values 0 or 1 using the rpart command. In my initial dataset I have few positive observations of the target variable; therefore I have oversampled the rare event by a multiple of 6 (i.e. from 762 to 4572). However, in my results, I

Re: [R] attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 5:22 AM, Karl Brand wrote: Cheers Bill. You got me halfway, since: temp - merge(x=x, y=y[,17, drop=FALSE], by=rownames, sort=FALSE) Error in fix.by(by.x, x) : 'by' must specify valid column(s) but, using row.names instead of rownames, like: temp - merge(x=x, y=y[,17,

Re: [R] attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'

2010-12-02 Thread Karl Brand
On 12/2/2010 11:36 AM, David Winsemius wrote: On Dec 2, 2010, at 5:22 AM, Karl Brand wrote: Cheers Bill. You got me halfway, since: temp - merge(x=x, y=y[,17, drop=FALSE], by=rownames, sort=FALSE) Error in fix.by(by.x, x) : 'by' must specify valid column(s) but, using row.names instead

[R] Hmm Topology restriction

2010-12-02 Thread Kishor Tappita
Dear List, We are using RHmm to cluster data through HMM. We would like to restrict the transition matrix of HMM, to get hierarchical connections between clusters. But, RHmm doesn't seem to support these restrictions. Can any one suggest a library to do that. Thanks, Kishor

Re: [R] using foreach (parallel processing)

2010-12-02 Thread Mike Marchywka
Date: Thu, 2 Dec 2010 11:06:14 +0100 From: r.m.k...@gmail.com To: santosh.srini...@gmail.com CC: r-help@r-project.org Subject: Re: [R] using foreach (parallel processing) -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/02/2010 10:56 AM,

Re: [R] using foreach (parallel processing)

2010-12-02 Thread Santosh Srinivas
Thanks. I guess I had to wait long enough to get the threads running and now they seem be on top gear. Hope this thing doesn't crash now! On Thu, Dec 2, 2010 at 3:36 PM, Rainer M Krug r.m.k...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/02/2010 10:56 AM, Santosh

Re: [R] how to update a bugs-model from inside R using R2WinBUGS

2010-12-02 Thread Frederic Holzwarth
I found a very simple way: you start winbugs from R and state: debug=TRUE, start maybe with few iterations, like 10. If everything goes fine, open a new empty odc document in winbugs. Now scan the log file and find something like this: update(10)

Re: [R] procrustes results affected by order of sites in input file

2010-12-02 Thread Gavin Simpson
On Wed, 2010-12-01 at 14:19 -0600, Christine Dolph wrote: Dear All, I am using a Procrustes analysis to compare two NMDS ordinations for the same set of sites. One ordination is based on fish data, the other is based on invertebrate data. Ordinations were derived using metaMDS() from the

[R] survival - summary and score test for ridge coxph()

2010-12-02 Thread Damjan Krstajic
It seems to me that summary for ridge coxph() prints summary but returns NULL. It is not a big issue because one can calculate statistics directly from a coxph.object. However, for some reason the score test is not calculated for ridge coxph(), i.e score nor rscore components are not included

[R] Пикап

2010-12-02 Thread Vovan
Пикап блог samec.org.ua один из лучший информативных сайтов о в Украине, который помогает мужчинам в разы улучшить их личную и сексуальную жизнь дает ответы на вопрос

[R] 1

2010-12-02 Thread Vovan
sd [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] rpart results - problem after oversampling

2010-12-02 Thread Jonathan P Daily
Short answer: Not really. Slightly longer answer: from what I remember of partitioning methods, a given split is made at either a single observation or between two consecutive observations. In your case, I estimate rpart would have split on that particular point... except that there are 6 of

[R] problem with package rsm: running fit.mult.impute with cph

2010-12-02 Thread David Foreman
Hi all (and especially Frank), I'm trying to use x=T, y=T in order to run a validated stepwise cox regression in rsm, having multiply imputed using mice. I'm coding model.max-fit.mult.impute(baseform,cph,miced2,dated.sexrisk2,x=T,y=T) baseform is baseform-Surv(si.age,si==Yes)~ peer.press +

[R] Last post: problem with package rsm: running fit.mult.impute with cph -- sorry, package was rms

2010-12-02 Thread David Foreman
Sorry everybody, temporary dyslexia. Sent from my BlackBerry wireless smartphone __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] warning creating an as.array method in a package

2010-12-02 Thread Michael Friendly
On 11/30/2010 5:59 PM, David Winsemius wrote: I'm guessing from this behavior on my system that it may be Matrix. showMethods(as.array) Function: as.array (package base) x=ANY x=Matrix I'm still perplexed by this. Running R CMD install gives this warning: ** testing if installed package

Re: [R] warning creating an as.array method in a package

2010-12-02 Thread Michael Friendly
On 12/2/2010 8:58 AM, Michael Friendly wrote: Under ?methods the Note says Functions can have both S3 and S4 methods, and function showMethods will list the S4 methods (possibly none). Does the warning mean that I cannot (or should not) have an S3 as.array method in a package? The method works

[R] Пикап

2010-12-02 Thread Vovan
Пикап блог samec.org.ua один из лучший информативных сайтов о в Украине, который помогает мужчинам в разы улучшить их личную и сексуальную жизнь дает ответы на вопрос

[R] How to call R-squared values from lm's?

2010-12-02 Thread Wegan, Michael (DNRE)
I would like to call both p-values and R-squared values from lm's in a function. I can get the p-values from coef(summary(name.lm))[r,c], however, I cannot figure out how to call the R-squared values without manually calling the summary and inserting them in the script - which negates the

[R] Suitable test for ordinal variable vs continuous variable trend

2010-12-02 Thread Daniel Brewer
Dear all, For a population of about 200 I have a continuous variable and an ordinal variable. The question I would like to ask is whether the continuously increases (or decreases) as the rank of the ordinal variable increases. I was thinking that a Spearmen's rank correlation or or a chi

Re: [R] How to call R-squared values from lm's?

2010-12-02 Thread Roland Rau
On 12/02/2010 03:15 PM, Wegan, Michael (DNRE) wrote: I would like to call both p-values and R-squared values from lm's in a function. I can get the p-values from coef(summary(name.lm))[r,c], however, I cannot figure out how to call the R-squared values without manually calling the summary

Re: [R] How to call R-squared values from lm's?

2010-12-02 Thread Marc Schwartz
On Dec 2, 2010, at 8:15 AM, Wegan, Michael (DNRE) wrote: I would like to call both p-values and R-squared values from lm's in a function. I can get the p-values from coef(summary(name.lm))[r,c], however, I cannot figure out how to call the R-squared values without manually calling the

[R] Пикап

2010-12-02 Thread Vovan
Пикап блог samec.org.ua один из лучший информативных сайтов о в Украине, который помогает мужчинам в разы улучшить их личную и сексуальную жизнь дает ответы на вопрос

[R] Пикап

2010-12-02 Thread Vovan
Пикап блог один из лучший информативных сайтов о в Украине, который помогает мужчинам в разы улучшить их личную и сексуальную жизнь дает ответы на вопрос как

Re: [R] attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 5:58 AM, Karl Brand wrote: On 12/2/2010 11:36 AM, David Winsemius wrote: On Dec 2, 2010, at 5:22 AM, Karl Brand wrote: Cheers Bill. Inserting earlier debris: I don't understand why i get this error message when attempting to use merge() - temp - merge(x,

[R] Пикап

2010-12-02 Thread Vovan
Пикап блог один из лучший информативных сайтов о в Украине, который помогает мужчинам в разы улучшить их личную и сексуальную жизнь дает ответы на вопрос как

[R] Пикап

2010-12-02 Thread Vovan
Пикап блог один из лучший информативных сайтов о в Украине, который помогает мужчинам в разы улучшить их личную и сексуальную жизнь дает ответы на вопрос как

[R] Please help......barplot2

2010-12-02 Thread David Lyon
Hi everyone I spent hours trying to figure this out but as a newbie I am stuck... can someone show me the R code for the following: If I had a tab delimited file called file, containing 3 rows : 9.568.679.288.817.939.858.9210.19 8.63 6.367.296.68

Re: [R] Hmm Topology restriction

2010-12-02 Thread Kishor Tappita
Dear Ingmar, Thanks a lot. Regards, Kishor On Thu, Dec 2, 2010 at 6:39 PM, Ingmar Visser i.vis...@uva.nl wrote: depmixS4 enables linear constraints on parameters, best, Ingmar On Thu, Dec 2, 2010 at 12:01 PM, Kishor Tappita kishor.tapp...@gmail.com wrote: Dear List, We are using RHmm to

[R] make check from R2.12.0.exe installation

2010-12-02 Thread elliott harrison
Hi, I typically install new versions of R on windows using the downloadable executable file rather than the full tar. I need to now document the success of the installation in addition to my preferred procedure of running an old dataset against the new build. I found quickly that this is all

[R] initial values for alpha and beta in Gamma inverse

2010-12-02 Thread Rosario Garcia Gil
Hello I am trying to fit a model using glm function with family=Gamma(link=inverse). Is it possible to give initial values, and how? I tried to search for info but not managed to get any answer. Kind regards and thanks in advance. Rosario [[alternative HTML version deleted]]

[R] plot more plots from one matrix

2010-12-02 Thread alcesgabbo
Hi, I have a dataframe like this: procedure propertysensor_data sensor_date | | | | [1,] PAT_Laser_2 Distance 30.42 2010-09-30T15:00:12+0200 [2,] PAT_Laser_2 Distance 31.22

Re: [R] Please help......barplot2

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 10:36 AM, David Lyon wrote: Hi everyone I spent hours trying to figure this out but as a newbie I am stuck... can someone show me the R code for the following: If I had a tab delimited file called file, Are you sure that you are not on an OS that hides the file

[R] Odp: Please help......barplot2

2010-12-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.12.2010 16:36:09: Hi everyone I spent hours trying to figure this out but as a newbie I am stuck... can someone show me the R code for the following: If I had a tab delimited file called file, containing 3 rows : 9.56 8.67 9.28 8.81

Re: [R] Please help......barplot2

2010-12-02 Thread David Lyon
Thanks David Do you have the url link that details the worked solution to my problem: that we have an extensive collection of documentation suitable for beginners that probably has similar problems worked out: If not can someone show me how to How do I import the file, then plot the mean and

Re: [R] attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'

2010-12-02 Thread Karl Brand
On 12/2/2010 3:52 PM, David Winsemius wrote: On Dec 2, 2010, at 5:58 AM, Karl Brand wrote: On 12/2/2010 11:36 AM, David Winsemius wrote: On Dec 2, 2010, at 5:22 AM, Karl Brand wrote: Cheers Bill. Inserting earlier debris: I don't understand why i get this error message when

[R] Help summarizing R data frame

2010-12-02 Thread chris99
I am trying to aggregate data in column 2 to identifiers in col 1 eg.. take this identifier quantity 1 10 1 20 2 30 1 15 2 10 3 20 and make this identifier

Re: [R] Please help......barplot2

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 11:10 AM, David Lyon wrote: Thanks David Do you have the url link that details the worked solution to my problem: that we have an extensive collection of documentation suitable for beginners that probably has similar problems worked out:

[R] 2D Random walk

2010-12-02 Thread featherbox
I've wrote some code to simulate a random walk in 2 dimensions on a lattice. Basically I want to add something in to make it plot it point by point so you can see what is going on. Heres my code for the random walk in 2d RW2D-function(N) { i-0 xdir-0 ydir-0 xpos-vector()

[R] Kalman filter

2010-12-02 Thread Santiago Ramos
I can say is used as filter Kalman thanks Cordialmente, JAVIER SANTIAGO PARRA RAMOS INGENIERO DE SISTEMAS ESP. EN GERENCIA DE SISTEMAS INFORMATICOS CEL: (57) 313 416 71 21 [[alternative HTML version deleted]]

Re: [R] Help summarizing R data frame

2010-12-02 Thread Ivan Calandra
see ?aggregate, and ?summaryBy (in package doBy) I think ddply (in package plyr) could also do the job Ivan Le 12/2/2010 17:24, chris99 a écrit : I am trying to aggregate data in column 2 to identifiers in col 1 eg.. take this identifier quantity 1 10 1

Re: [R] attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'

2010-12-02 Thread William Dunlap
I didn't change your rownames to row.names because I figured you had the name you wanted but only forgot to include the quotes. Both rownames and row.names are valid inputs, but they mean different things. Howver, without the quotes you were passing in the contents of the object called rownames,

Re: [R] Help summarizing R data frame

2010-12-02 Thread Mike Rennie
see also tapply() e.g. a-c(1,1,1,2,2,2,3,3,3) b-c(10,10,10,15,15,15,20,20,20) c.dat-data.frame(a,b) tapply(c.dat[,2],c.dat[,1],sum) Mike On Thu, Dec 2, 2010 at 10:33 AM, Ivan Calandra ivan.calan...@uni-hamburg.de wrote: see ?aggregate, and ?summaryBy (in package doBy) I think ddply (in

Re: [R] Help summarizing R data frame

2010-12-02 Thread Patrick Hausmann
Here are some examples with tapply, aggregate, ddply: x - read.table(clipboard, head=TRUE) with(x, tapply(quantity, identifier, sum)) aggregate(x$quantity, by=list(x$identifier), sum) aggregate(quantity ~ identifier, data = x, sum) library(plyr) ddply(x, .(identifier), summarise,

Re: [R] 2D Random walk

2010-12-02 Thread Patrick Burns
Hopefully someone has a good suggestion for your question. I'd just like to point out that the generation of the random walk is pretty much optimized for worst performance. A 'for' loop is not necessary and growing the objects could be a very significant drag. See Circles 2 and 3 of 'The R

Re: [R] Help summarizing R data frame

2010-12-02 Thread jim holtman
Nice thing about R is there are a number of ways to do things: x identifier quantity 1 1 10 2 1 20 3 2 30 4 1 15 5 2 10 6 3 20 require(sqldf) sqldf('select identifier, sum(quantity) as quantity from x

Re: [R] Help summarizing R data frame

2010-12-02 Thread Henrique Dallazuanna
Try this: with(DF, rowsum(quantity, identifier)) On Thu, Dec 2, 2010 at 2:24 PM, chris99 chea...@hotmail.com wrote: I am trying to aggregate data in column 2 to identifiers in col 1 eg.. take this identifier quantity 1 10 1 20 2

Re: [R] attempted merge() returns: cannot coerce type 'closure' to vector of type 'any'

2010-12-02 Thread Karl Brand
Cheers Bill, Thank you for the clarificaiton. Prabably showing the str() of these objects would have made it easier for you see exatly where i was going wrong. Which as David pointed out, was really a lack of ?merge reading...:) Karl On 12/2/2010 5:46 PM, William Dunlap wrote: I didn't

Re: [R] procrustes results affected by order of sites in input file

2010-12-02 Thread Christine Dolph
Hi, Thanks very much for your response. Unfortunately, using the set.seed() call does not seem to solve my problem. If I do not use set.seed(), I do indeed get some small differences in protest() results due to the effect of random starts. But with my sites in a given order in the input files,

Re: [R] 2D Random walk

2010-12-02 Thread jim holtman
Here is a use of color to show what the path is and following up on Patrick's post to make the code a little more efficient: # compute path n - 1 rw - matrix(0, ncol = 2, nrow = n) # generate the indices to set the deltas indx - cbind(seq(n), sample(c(1, 2), n, TRUE)) # now set the values

[R] Tukey Test after lme, error: less than two groups

2010-12-02 Thread Lilith Epperlein
Dear R-group, I am trying desperately to get this Tukey test working. Its my first time here so I hope my question is not too stupid, but I couldn't find anything helpful in the help or in the forum. I am analysing a dataset of treated grasses. I want to find out, if the grasses from

[R] Hmisc label function applied to data frame

2010-12-02 Thread Krishna Tateneni
Hello, I'm attempting to create a data frame with correlations between every pair of variables in a data frame, so that I can then sort by the value of the correlation coefficient and see which pairs of variables are most strongly correlated. The sm2vec function in the corpcor library works very

[R] openNLP package error

2010-12-02 Thread Sascha Wolfer
Hello list, I seem to have a problem with the openNLP package, I'm actually stuck in the very beginning. Here's what I did: install.packages(openNLP) install.packages(openNLPmodels.de, repos = http://datacube.wu.ac.at/;, type = source) library(openNLPmodels.de) library(openNLP) So I

[R] Tukey Test, lme, error: less than two groups

2010-12-02 Thread Lilith
Dear R-group, I am trying desperately to get this Tukey test working. Its my first time here so I hope my question is not too stupid, but I couldn't find anything helpful in the help or in the forum. I am analysing a dataset of treated grasses. I want to find out, if the grasses from different

Re: [R] Suitable test for ordinal variable vs continuous variable trend

2010-12-02 Thread Greg Snow
There are many possibilities depending on what you are really looking for (strict increasing, vs. increasing or constant, vs. general trend, etc.) I would start with a plot of the data, that may result in a significant interocular concussion test and will at least help you understand what is

[R] StatET: Connecting to a remote rterm instance

2010-12-02 Thread WanderingWizard
Is it possible to use Eclipse (StatET) to connect to an rterm instance running on another computer? It looks like it should be easy, but when I select an R Engine it says Connection failed to: hostname everytime. Is there a guide somewhere? -- View this message in context:

Re: [R] StatET: Connecting to a remote rterm instance

2010-12-02 Thread Tobias Verbeke
Dear WanderingWizard, On 12/02/2010 07:58 PM, WanderingWizard wrote: Is it possible to use Eclipse (StatET) to connect to an rterm instance running on another computer? Yes. You can launch, disconnect and reconnect to a remote R console. It looks like it should be easy, but when I select

[R] Extreme value probabilities

2010-12-02 Thread Sarah Henderson
Greetings to all -- I have a set of ~1300 radon measurements from homes across British Columbia in Canada. We have split these measurements into five groups according the the tectonic belt in which they fall, with N ranging from ~160 to ~600 measurements per group. The values are roughly

[R] Filter data

2010-12-02 Thread Diogenas
Hello, I understand that question is probably stupid, but ... I have data (polity IV index) country,year,democ,autoc,polity,polity2 1,Afghanistan ,1800,1,7,-6,-6 2,Afghanistan ,1801,1,7,-6,-6 3,Afghanistan ,1802,1,7,-6,-6 I need to create new data sets which

[R] Женская логика

2010-12-02 Thread Vovan
Хотите понимать женщин? Знать реальные их мысли, когда они пытаются спрятать их за совершенно отвлеченными речами? На практических тренингах Академии Знакомств

[R] Женская логика

2010-12-02 Thread Vovan
Хотите понимать женщин? Знать реальные их мысли, когда они пытаются спрятать их за совершенно отвлеченными речами? На практических тренингах Академии Знакомств

[R] Женская логика

2010-12-02 Thread Vovan
Хотите понимать женщин? Знать реальные их мысли, когда они пытаются спрятать их за совершенно отвлеченными речами? На практических тренингах Академии Знакомств

[R] Женская логика

2010-12-02 Thread Vovan
Хотите понимать женщин? Знать реальные их мысли, когда они пытаются спрятать их за совершенно отвлеченными речами? На практических тренингах Академии Знакомств

[R] Женская логика

2010-12-02 Thread Vovan
Хотите понимать женщин? Знать реальные их мысли, когда они пытаются спрятать их за совершенно отвлеченными речами? На практических тренингах Академии Знакомств

[R] Женская логика

2010-12-02 Thread Vovan
Хотите понимать женщин? Знать реальные их мысли, когда они пытаются спрятать их за совершенно отвлеченными речами? На практических тренингах Академии Знакомств

[R] latex tables for 3+ dimensional tables/arrays

2010-12-02 Thread Michael Friendly
I'm looking for an R method to produce latex versions of tables for table/array objects of 3 or more dimensions, which, of necessity is flattened to a 2D display, for example with ftable(), or vcd::structable, as shown below. I'd be happy to settle for a flexible solution for the 3D case. UCB

Re: [R] Filter data

2010-12-02 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Diogenas Sent: Thursday, December 02, 2010 12:09 PM To: r-help@r-project.org Subject: [R] Filter data Hello, I understand that question is probably stupid, but ... I

Re: [R] latex tables for 3+ dimensional tables/arrays

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 3:47 PM, Michael Friendly wrote: I'm looking for an R method to produce latex versions of tables for table/array objects of 3 or more dimensions, which, of necessity is flattened to a 2D display, for example with ftable(), or vcd::structable, as shown below. I'd be happy

Re: [R] Filter data

2010-12-02 Thread Diogenas
Simplified version of str(poli): (real dataset includes 36 variables) $ country : chr [1:15846] Afghanistan Afghanistan Afghanistan Afghanistan ... $ year: num [1:15846] 1800 1801 1802 1803 1804 ... $ democ : num [1:15846] 1 1 1 1 1 1

Re: [R] problem with package rsm: running fit.mult.impute with cph

2010-12-02 Thread Frank Harrell
rms and fit.mult.impute don't necessarily play well with mice. Note also that you will need a special adjustment for variances for having done stepwise regression. One approach is to insert a zero for a coefficient every time that variable is not 'selected', then compute the sample variance of

[R] MANOVA Type III SS

2010-12-02 Thread Ali S
How do I get MANOVA results with Type III sums of squares? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Integral of PDF

2010-12-02 Thread Doran, Harold
The integral of any probability density from -Inf to Inf should equal 1, correct? I don't understand last result below. integrate(function(x) dnorm(x, 0,1), -Inf, Inf) 1 with absolute error 9.4e-05 integrate(function(x) dnorm(x, 100,10), -Inf, Inf) 1 with absolute error 0.00012

Re: [R] MANOVA Type III SS

2010-12-02 Thread David Winsemius
On Dec 2, 2010, at 4:18 PM, Ali S wrote: How do I get MANOVA results with Type III sums of squares? First pull on your asbestos underwear, then visit :

Re: [R] Significance of the difference between two correlation coefficients

2010-12-02 Thread Norm Matloff
Adaikalavan Ramasamy wrote: Using the info from that website, I can code up the following to give the two-tailed p-value of difference in correlations: diff.corr - function( r1, n1, r2, n2 ){ ... William Revelle also mentioned the r.test in the psych package. I would add here that

[R] parLapply - Error in do.call(fun, lapply(args, enquote)) : could not find function fun

2010-12-02 Thread Adrienne Wootten
Hello everybody, I've got a bit of a problem with parLapply that's left me scratching my head today. I've tried this in R 2.11 and the 23 bit Revolution R Enterprise and gotten the same result, OS in question is Windows XP, the package involved is the snow package. I've got a list of 20 rain/no

Re: [R] latex tables for 3+ dimensional tables/arrays

2010-12-02 Thread Michael Friendly
On 12/2/2010 4:04 PM, David Winsemius wrote: ?latex # yes I know you are aware of this but it seemed as though you hadn't read its help page. # Attached is the output on my device from the following command: latexVerbatim( ftable(UCB)) Perhaps I should have been more explicit. I can

Re: [R] Filter data

2010-12-02 Thread mohamed . lajnef
Hi Diogenas, Try this, data-subset(poli, poli$year1994) Best, M Diogenas dioge...@gmail.com a écrit : Hello, I understand that question is probably stupid, but ... I have data (polity IV index) country,year,democ,autoc,polity,polity2 1,Afghanistan ,1800,1,7,-6,-6 2,Afghanistan

Re: [R] Filter data

2010-12-02 Thread Mike Rennie
Try looking at subset()... I typically use this when I'm trying to isolate specific cases from a data frame. Also, Dalgaard's introductory R book has some great examples for parsing data in the manner you're attempting you might want to look at that. Mike On Thu, Dec 2, 2010 at 2:08 PM,

Re: [R] Arrange elements on a matrix according to rowSums + short 'apply' Q

2010-12-02 Thread Aaron Polhamus
Ivan and Michael, Many thanks for the tips, those solved my queries. Still interested in how to force custom functions to work over rows rather than columns when using apply, but the MAT/rowSums(MAT) technique is definitely the most efficient way to go for this application. Cheers, Aaron

Re: [R] Tukey Test, lme, error: less than two groups

2010-12-02 Thread Steven McKinney
Comments in-line below -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Lilith Sent: December-02-10 9:39 AM To: r-help@r-project.org Subject: [R] Tukey Test, lme, error: less than two groups Dear R-group, I am trying

Re: [R] Integral of PDF

2010-12-02 Thread Hans W Borchers
You can dive into the thread puzzle with integrate over infinite range from September this year. The short answer appears to be: Increase the error tolerance. integrate(function(x) dnorm(x, 500,50), -Inf, Inf, subdivisions=500, rel.tol=1e-11) # 1 with absolute error

Re: [R] latex tables for 3+ dimensional tables/arrays

2010-12-02 Thread RICHARD M. HEIBERGER
Michael, I think this is what you are looking for. Rich library(Hmisc) tmp - array(rnorm(60), c(3,4,5), list(letters[1:3],LETTERS[4:7],letters[8:12])) ## latex(tmp) ftable(tmp) dviname - latex(ftable(tmp)) ft - ftable(tmp) dviname - latex(ft, colheads=attr(ft,col.vars)[[1]],

Re: [R] Integral of PDF

2010-12-02 Thread Albyn Jones
To really understaand it you will have to look at the fortran code underlying integrate. I tracked it back through a couple of layers (dqagi, dqagie, ... just use google, these are old netlib subroutines) then decided I ought to get back to grading papers :-) It looks like the integral is split

[R] initial values for alpha and beta in Gamma inverse

2010-12-02 Thread Rosario Garcia Gil
Hello I am trying to fit a model using glm function with family=Gamma(link=inverse). Is it possible to give initial values, and how? I tried to search for info but not managed to get any answer. Kind regards and thanks in advance. Rosario [[alternative HTML version deleted]]

Re: [R] Integral of PDF

2010-12-02 Thread William Dunlap
You can use trace() to see what is happening trace(dnorm, quote(print(round(x integrate(function(x) dnorm(x, 500,50), -Inf, Inf) Tracing dnorm(x, 500, 50) on entry [1] 1 233 0 38 0 14 0 7 0 4 0 2 0 2 1 Tracing dnorm(x, 500, 50) on entry [1] -1 -2330 -38

Re: [R] Minor warning about seq

2010-12-02 Thread Carl Witthoft
I believe the R intro manual and R-inferno have some pretty stern warnings about never using 'c' or 't' as variable names, for obvious reasons. Similarly, I nearly crushed some code once by writing a nice little function to find the mode of a data set and calling the function mode() .

Re: [R] Integral of PDF

2010-12-02 Thread Ravi Varadhan
But that only postpones the misery, Hans Werner! You can always make the mean large enough to get a wrong answer from `integrate'. integrate(function(x) dnorm(x, 700,50), -Inf, Inf, subdivisions=500, rel.tol=1e-11) integrate(function(x) dnorm(x, -700,50), -Inf, Inf,

Re: [R] Integral of PDF

2010-12-02 Thread Ted Harding
Albyn's reply is in line with an hypothesis I was beginning to formulate (without looking at the underlying FoRTRAN code), prompted by the hint in '?integrate': Details: If one or both limits are infinite, the infinite range is mapped onto a finite interval. For a finite

Re: [R] Arrange elements on a matrix according to rowSums + short 'apply' Q

2010-12-02 Thread Petr Savicky
On Thu, Dec 02, 2010 at 01:13:40PM -0800, Aaron Polhamus wrote: ... Many thanks for the tips, those solved my queries. Still interested in how to force custom functions to work over rows rather than columns when using apply, In the command TMAT - apply(MAT, 1, function(X) X/sum(X)) the

Re: [R] Integral of PDF

2010-12-02 Thread Albyn Jones
On Thu, Dec 02, 2010 at 06:23:45PM -0500, Ravi Varadhan wrote: A simple solution is to locate the mode of the integrand, which should be quite easy to do, and then do a coordinate shift to that point and then integrate the mean-shifted integrand using `integrate'. Ravi. Translation: think

[R] kmeans() compared to PROC FASTCLUS

2010-12-02 Thread Andrew Agrimson
Hello all, I've been comparing results from kmeans() in R to PROC FASTCLUS in SAS and I'm getting drastically different results with a real life data set. Even with a simulated data set starting with the same seeds with very well seperated clusters the resulting cluster means are still different.

[R] The behaviour of read.csv().

2010-12-02 Thread Rolf Turner
I have recently been bitten by an aspect of the behaviour of the read.csv() function. Some lines in a (fairly large) *.csv file that I read in had too many entries. I would have hoped that this would cause read.csv() to throw an error, or at least issue a warning, but it read the file without

  1   2   >