Re: [R] ON MAC, how to copy a plot on to Word document?

2009-02-25 Thread Peabody
To avoid the Word 2004 issue, copy the plot window then in preview select new from cliboard. Copy and paste into Word 2004. -- View this message in context: http://www.nabble.com/ON-MAC%2C-how-to-copy-a-plot-on-to-Word-document--tp19354558p22217935.html Sent from the R help mailing list archive

Re: [R] Computing sd across an array with missing values

2009-02-25 Thread Matt Oliver
Hi Jorge, this does not seem to return the same thing as p <- array(c(1:5, rep(NA, times = 3)), dim = c(5, 5, 3)) sd_fun <- function(i){ if(sum(!is.na(i))==0){ temp.sd <- NA }else{ temp.sd <- sd(i, na.rm = TRUE) } return(temp.sd) } apply(p, 1:2, sd_fun) Am I missing something basic here? On We

Re: [R] Anova Help?

2009-02-25 Thread Dar
Independent Variables: 5 different levels of exposure to information: no information, appearance information, educational information, contact information, and personal information. The types Unranked Categorical Variable Dependent Variables: 2 and are numerical The dependent variable will be (2

[R] Choosing how to vary slopes and intercepts in a hierarchical model

2009-02-25 Thread jjh21
Hi, Is there any set of rules for deciding exactly how to vary slopes and intercepts in a HLM? I have NOMINATE scores from the senate over three years. So I have multiple observations of senators, nested in states, nested in years. Covariates include level-1 (senator in a specific year) variables

[R] T-test by groups

2009-02-25 Thread Ingrid Tohver
I would like to run a t-test within a "by" group function. My dataset, "error", is organized as the following (I have 133 Sites): Site week Dataset Region lat_map long_map mean_tsim diff20 diff40 diff80 ALFI 15 USACE UC 48.15625 -117.0938 8.87 1.34 1.90 2.98 ALFI 16

[R] left truncated data and survival analysis

2009-02-25 Thread Philippe Guardiola
Hello, I d like to run a survival analysis with "left truncated data". Could you recommend me a package to do this please ? Thanks Philippe Guardiola [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat

Re: [R] windows vs. linux code

2009-02-25 Thread Prof Brian Ripley
I think what in my experience is the most common causen for R code being confined to one platform has not yet been mentioned: it needs a package that is only available on one platform: of CRAN/BioC packages that is only a small proprtion, but out of 2000 a small proportion is still tens. On T

Re: [R] left truncated data survival analysis package

2009-02-25 Thread Thomas Lumley
On Thu, 26 Feb 2009 phguard...@aol.com wrote: Hello, I d like to run a survival analysis with "left truncated data". Could you recommend me a package to do this please ? The 'survival' package. -thomas Thomas Lumley Assoc. Professor, Biostatistics tlum...@u.washingto

Re: [R] R question - combine values

2009-02-25 Thread markleeds
oops, then i guess i should not have sent the recode suggestion. choonhong: I only sent it as an example of how to recode your factor. I didn't mean to imply ( nor did i even give it much thought ) that what you're doing is statistically/philosophically correct. I'm a friend but I think what D

Re: [R] R question - combine values

2009-02-25 Thread markleeds
Hi: John Fox's recode function in his car package provides a convenient way for doing what you need. I don't know what your factor is specifically but below is mostly taken out of the help for "recode" and shows how to take a factor and recode it to make it a new factor. you can apply that for

[R] left truncated data survival analysis package

2009-02-25 Thread phguardiol
Hello, I d like to run a survival analysis with "left truncated data". Could you recommend me a package to do this please ? Thanks Philippe Guardiola Reçevez AOL Mail sur votre téléphone. Vos e-mails accessibles à tout m

Re: [R] windows vs. linux code

2009-02-25 Thread Kingsford Jones
X11() on my Vista machine running 2.8.1 seems to work the same as windows(). From the help page, the only difference I see is that 'X11' (and 'x11') have only width, height and pointsize arguments ('windows' has another 13). Kingsford On Wed, Feb 25, 2009 at 8:58 PM, Ted Harding wrote: > There

Re: [R] windows vs. linux code

2009-02-25 Thread Sherri Heck
hi ted- thanks for your insight. i appreciate it. sherri (Ted Harding) wrote: There is one MAJOR issue you will have to watch out for, far more likely to turn up than calls like system(). This is that, if you want to have two or more plotting windows in use at the same time, while the first o

Re: [R] windows vs. linux code

2009-02-25 Thread Gabor Grothendieck
On Wed, Feb 25, 2009 at 10:58 PM, Ted Harding wrote: > >  if(length(grep("linux",R.Version()$os))){ >  windows <- function( ... ) X11( ... ) > } > Try if (.Platform$OS.type == "windows") ... else ... __ R-help@r-project.org mailing list https://stat.e

Re: [R] R question - combine values

2009-02-25 Thread David Winsemius
You don't. And even if you do get someone to tell you how, you may still not legitimately lower your degrees of freedom. Friends don't let friends use stepwise approaches to regression analysis. -- David Winsemius On Feb 25, 2009, at 10:33 PM, choonhong ang wrote: The district a is the b

Re: [R] reshape from wide to long

2009-02-25 Thread Gabor Grothendieck
Try: reshape(x, dir = "long", idvar = 1, times = cn[-1], varying = list(cn[-1]), v.names = "X", timevar = "Name") On Wed, Feb 25, 2009 at 11:01 PM, Juliet Hannah wrote: > Out of curiosity, what would be a good way to do this without using > the reshape package? Thanks! > > On Wed, Feb 25, 2009

Re: [R] indexing model names for AICc table

2009-02-25 Thread Kingsford Jones
Aslo note there are a number of packages with functions producing Burnham and Anderson style AIC tables: pgirmess, bbmle, dRedging(off-CRAN), PKtools, ... On Wed, Feb 25, 2009 at 4:58 PM, Mark Drever wrote: > hi folks, > > I'm trying to build a table that contains information about a series of >

Re: [R] Importing zoo object ("index contains NAs")

2009-02-25 Thread Gabor Grothendieck
Without a reproducible example, i.e. the input file, one can't say much but in general you could read it in using read.table, remove the NAs and then convert it to zoo. On Wed, Feb 25, 2009 at 11:29 PM, Rob Denniker wrote: > Dear list, > > I have an irregular time series saved and exported as a z

[R] Importing zoo object ("index contains NAs")

2009-02-25 Thread Rob Denniker
Dear list, I have an irregular time series saved and exported as a zoo object. What is the trick to force zoo to ignore the missing dates when reading it back in? Thanks. > str(g) ‘zoo’ series from 1948-11-02 to 2012-11-06 Data: num [1:14881, 1:8] 1 0 0 0 0 0 0 0 0 0 ... - attr(*, "dimnames")

Re: [R] reshape from wide to long

2009-02-25 Thread hadley wickham
On Wed, Feb 25, 2009 at 10:01 PM, Juliet Hannah wrote: > Out of curiosity, what would be a good way to do this without using > the reshape package? Thanks! Well the core of the melt code is this: ids <- data[, var$id, drop = FALSE] df <- do.call("rbind", lapply(var$measure, function(x) {

Re: [R] reshape from wide to long

2009-02-25 Thread Juliet Hannah
Out of curiosity, what would be a good way to do this without using the reshape package? Thanks! On Wed, Feb 25, 2009 at 8:04 PM, jim holtman wrote: > You can use the 'reshape' package: > >> x <- read.table(textConnection(" Grp        X0        X3               X6     >>       X12          X25  

Re: [R] windows vs. linux code

2009-02-25 Thread Ted Harding
There is one MAJOR issue you will have to watch out for, far more likely to turn up than calls like system(). This is that, if you want to have two or more plotting windows in use at the same time, while the first one is autoatically opened by the plot() command, you will have to open additional o

Re: [R] Modifying Names from (x,y] into x

2009-02-25 Thread Rolf Turner
On 26/02/2009, at 4:15 PM, David Winsemius wrote: dat <- c(1,2,3) names(dat) <- c(-2329, -1399, -669.4) dat -2329 -1399 -669.4 1 2 3 -- David Winsemius On Feb 25, 2009, at 9:55 PM, Gundala Viswanath wrote: Hi, I have the following data that looks like this: na

Re: [R] interpSpline with dates?

2009-02-25 Thread Remko Duursma
Thanks for that... the error message threw me off. r - Remko Duursma Post-Doctoral Fellow Centre for Plant and Food Science University of Western Sydney Hawkesbury Campus Richmond NSW 2753 Dept of Biological Science Macquarie University North Ryd

[R] R question - combine values

2009-02-25 Thread choonhong ang
The district a is the baseline and we observe the difference between District a & b is not significant, we can choose to combine these 2 values. How to write code to combine these 2 value ? > m1=glm(Claims~District+Group+Age+log(Holders),fami ly=poisson,data=mydata) > summary(m1) Call: glm(formul

Re: [R] Modifying Names from (x,y] into x

2009-02-25 Thread David Winsemius
> dat <- c(1,2,3) > names(dat) <- c(-2329, -1399, -669.4) > dat -2329 -1399 -669.4 1 2 3 -- David Winsemius On Feb 25, 2009, at 9:55 PM, Gundala Viswanath wrote: Hi, I have the following data that looks like this: names(dat) [1] "(-2329,-2319]" "(-1399,-1389]"

[R] How do I retrieve column and row names after comparing two matrices?

2009-02-25 Thread Nussenzveig, Roberto H.
Hello, I have two matrices as shown below: Matrix 1 IDAB1BC1CD1... name1 1,1 2,1 0,2 ... name2 2,0 1,2 1,2 ... name3 0,2 1,1 2,0 ... name4 2,0 0,2 0,2

Re: [R] interpSpline with dates?

2009-02-25 Thread David Winsemius
It certainly appears that you just _did_ use it as such. You got a spline. The only error thrown was from predict() and I think that was because you needed to use a bit of extra coercion. > predict(sp, x=as.numeric(as.POSIXct("2008-08-02"))) $x [1] 1217649600 $y [1] -0.4748701 attr(,"class"

[R] Modifying Names from (x,y] into x

2009-02-25 Thread Gundala Viswanath
Hi, I have the following data that looks like this: > names(dat) [1] "(-2329,-2319]" "(-1399,-1389]" "(-669.4,-659.4]" How can I modify those names into just this? [1] -2329 -1399 -669.4 - Gundala Viswanath Jakarta - Indonesia

[R] interpSpline with dates?

2009-02-25 Thread Remko Duursma
Dear R-helpers, can I use a POSIXct date as the x variable in interpSpline? The help page says x and y need to be numeric... is there a workaround? example: library(splines) testdfr <- data.frame(Date=seq(as.POSIXct("2008-08-01"),as.POSIXct("2008-09-01"), length=10)) testdfr$yvar <- rnorm(10) s

[R] Hi, Coding problem

2009-02-25 Thread Ssophia
Hi, there Below is my code to one Homework question. I couldn't come up with the reasonable answer. could you please help me to figure out what is the problem with my code? thank you Question is Coding P{X=j} =(1/2)^(j+1) + (1/2) *2^(j-1)/3^j my code is sim <-

[R] two colors and putting lines on bar plots

2009-02-25 Thread John Malone
Hi all, I want to represent two categories with one color and have other categories a different color on a bar plot. I can do this using for one category/number using the ifelse call in col but how to extend to two categories/numbers? barplot(dataframe$vector_o_numbers, col=ifelse(dataframe$vect

Re: [R] windows vs. linux code

2009-02-25 Thread Murray Cooper
I'm deeply disappointed! I keep checking the mail list to see if you guys are posting answers to questions I haven't asked yet. It would save me a lot of time! Best, Murray - Original Message - From: "Rolf Turner" To: "Sherri Heck" Cc: Sent: Wednesday, February 25, 2009 8:16 PM S

Re: [R] windows vs. linux code

2009-02-25 Thread Duncan Murdoch
On 25/02/2009 8:19 PM, jdeisenberg wrote: Sherri Heck wrote: I have been given some Rcode that was written using a Linux OS, but I use Windows-based R. The person that is giving it to me said that it needs to run on a Linux system. Does anyone have any insight and/or can verify this. I ha

Re: [R] windows vs. linux code

2009-02-25 Thread Sherri Heck
hahaha! okay. at least your responses are positive! thx! David Winsemius wrote: Definitely "maybe". Possibly "yes". Usually. Pick one of the above. -- David Winsemius On Feb 25, 2009, at 8:25 PM, Sherri Heck wrote: i am asking if, in general, r code can be written on a linux-based system

Re: [R] windows vs. linux code

2009-02-25 Thread jdeisenberg
Sherri Heck wrote: > > i am asking if, in general, r code can be written on a linux-based > system and then run on a windows-based system. > Yes, if you avoid system-dependent calls like, um, system , there should be no problem. For example, normal stuff like t test, correlation, plot, hist,

Re: [R] windows vs. linux code

2009-02-25 Thread David Winsemius
Definitely "maybe". Possibly "yes". Usually. Pick one of the above. -- David Winsemius On Feb 25, 2009, at 8:25 PM, Sherri Heck wrote: i am asking if, in general, r code can be written on a linux-based system and then run on a windows-based system. Rolf Turner wrote: On 26/02/2009, at

Re: [R] windows vs. linux code

2009-02-25 Thread Sherri Heck
i am asking if, in general, r code can be written on a linux-based system and then run on a windows-based system. Rolf Turner wrote: On 26/02/2009, at 2:08 PM, Sherri Heck wrote: Dear All- I have been given some Rcode that was written using a Linux OS, but I use Windows-based R. The perso

Re: [R] windows vs. linux code

2009-02-25 Thread jdeisenberg
Sherri Heck wrote: > > I have been given some Rcode that was written using a Linux OS, but I > use Windows-based R. The person that is giving it to me said that it > needs to run on a Linux system. Does anyone have any insight and/or can > verify this. I haven't yet obtained the code, so

Re: [R] windows vs. linux code

2009-02-25 Thread Rolf Turner
On 26/02/2009, at 2:08 PM, Sherri Heck wrote: Dear All- I have been given some Rcode that was written using a Linux OS, but I use Windows-based R. The person that is giving it to me said that it needs to run on a Linux system. Does anyone have any insight and/ or can verify this. I haven't

[R] windows vs. linux code

2009-02-25 Thread Sherri Heck
Dear All- I have been given some Rcode that was written using a Linux OS, but I use Windows-based R. The person that is giving it to me said that it needs to run on a Linux system. Does anyone have any insight and/or can verify this. I haven't yet obtained the code, so I haven't been able t

Re: [R] logistic regression - unequal groups in R

2009-02-25 Thread David Winsemius
On Feb 25, 2009, at 7:36 PM, ekwaters wrote: I am getting a repeated error when I try to run a logistic regression in R 2.8.1 (glm(prop1~x1,data=glm1,family=binomial("logit"),weights=nt1)) Error in model.frame.default(formula = prop1 ~ x1, data = glm1, weights = nt1, : invalid type (

Re: [R] reshape from wide to long

2009-02-25 Thread jim holtman
You can use the 'reshape' package: > x <- read.table(textConnection(" GrpX0X3 X6 > X12 X25 X50 +1C 0.5326517 0.6930942 0.9403883 1.157571 2.483117 2.809012 + 2C 0.4715917 0.8613200 2.0706117 2.937632 7.530960 7.120678 + 3

Re: [R] indexing model names for AICc table

2009-02-25 Thread Jorge Ivan Velez
Dear Mark, Try this: models<-paste("model",1:3,sep="") t(sapply(models,function(x){ m<-get(x) c(aic=AIC(m),LL=logLik(m)) } ) ) See ?get, ?AIC, ?logLik and ?sapply for more information. HTH, Jorge On Wed, Feb 25, 2009 at 6:58 PM, Mark Drever wrote

[R] logistic regression - unequal groups in R

2009-02-25 Thread ekwaters
I am getting a repeated error when I try to run a logistic regression in R 2.8.1 >(glm(prop1~x1,data=glm1,family=binomial("logit"),weights=nt1)) Error in model.frame.default(formula = prop1 ~ x1, data = glm1, weights = nt1, : invalid type (list) for variable 'x1' x1 is multistate categorical

Re: [R] indexing model names for AICc table

2009-02-25 Thread David Winsemius
I think part of your problem with your chosen method of attack arises from your misspelling of the logLik function. The other part arises because you have not yet digested FAQ 7.20: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f I haven't have much

[R] indexing model names for AICc table

2009-02-25 Thread Mark Drever
hi folks, I'm trying to build a table that contains information about a series of General Linear Models in order to calculate Akaike weights and other measures to compare all models in the series. i have an issue with indexing models and extracting the information (loglikehood, AIC's, etc.)

[R] Place independent labels between values on x-axis

2009-02-25 Thread T.D.Rudolph
I conducted a frequency averaging procedure which left me with the data frame below (Bin is an artifact of a cut() procedure and can be either as.character or as.factor): Bin Freq 1 (-180,-160] 7.904032 2 (-160,-140] 5.547901 3 (-140,-120] 4.522542 4 (-120,-100] 4.784184 5 (-

[R] Strange behavior of savePlot

2009-02-25 Thread Christophe Genolini
Hi all, I am using savePlot in a loop for saving several graph but I get some graph in 553x552, some other in 1920x1119. How comes ? My data are almost all the same (same label, same xlim / ylim, almost same data. Only the color changes). I save them in bmp. Thanks for your help. Christophe

[R] basketball (was: R spam)

2009-02-25 Thread Alan Zaslavsky
Not to draw this off-topic thread out too long, but perhaps there are enough interested to make it worthwhile: > And, since my son asked me and I am basketball ignorant: Why are > basketball scores mostly much too close to equality? The arguments > (loose power when leading) The relevant rul

[R] how to generate random numbers of a specific distribution in a squared normal distribution metric?

2009-02-25 Thread WEI LI
I want to generate or simulate random numbers from a distribution within a uniform metric of standard normal distribution. For example, how to simulate a distribution called A which satisfies that the largest absolute difference is equal to 0.1 between CDFof A and CDF of standard normal distribu

Re: [R] reshape from wide to long

2009-02-25 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
You didn't really provide enough detail on how you wanted the data reshaped, but I'll take a guess: > reshape(dat.1, direction='long', varying=paste('X',c(0,3,6,12,25,50),sep=''), sep='') Grp time X id 1.0 C0 0.5326517 1 2.0 C0 0.4715917 2 3.0 C0 0.5021

Re: [R] Formatting numeric values in a data frame

2009-02-25 Thread Pele
Jim - example is perfect - many thanks!!! Philipp - many thanks for your example also. jholtman wrote: > > This might do what you want: > >> x <- read.table(textConnection("ID x1 >> >> x2 x3 > + a1 0.0123334

Re: [R] problems with arrangement of figures by layout function

2009-02-25 Thread Greg Snow
The plot of the tree uses base graphics (works with layout). The histogram function is a lattice/trellis graph that uses grid graphics (at least the histogram function that I am aware of). Unfortunately base and grid graphics do not play nicely together without some additional steps. Some opt

[R] reshape from wide to long

2009-02-25 Thread Veerappa Chetty
Hi,I would like to reshape the following "wide" data set to "long" form. I would appreciate help with the correct code for "reshape". I tried a few unsuccessfully. Thanks. Chetty __ dat.1 GrpX0X3 X6 X12

[R] problems with arrangement of figures by layout function

2009-02-25 Thread Weidong Gu
Hi, I want to have histograms behind the regression tree figure. Since 7 leafs resulted from the tree model (rpart), it would be nice to have correspondent histograms below the tree figure. After a little study, I could generate the correspondent histogram for each leaf, but can't figure out how

Re: [R] Formatting numeric values in a data frame

2009-02-25 Thread jim holtman
This might do what you want: > x <- read.table(textConnection("ID x1 >x2 x3 + a1 0.0123334 0.2 12.8 + b3 0.477896366 0.2 9.6 +

Re: [R] Formatting numeric values in a data frame

2009-02-25 Thread Philipp Pagel
On Wed, Feb 25, 2009 at 01:19:36PM -0800, Pele wrote: > > Hi R users, > > I have a data frame that contains 10K obs and 200 variables > where I am trying to format the numeric columns to look > like the output table below (format to 2 decimal places) but I am > having no luck.. Can someone tell

[R] fractional polynomials

2009-02-25 Thread b g
Does anyone understand the protocol set forth in Sauerbrei's and Royston's Multivariable Modeling book on fitting interactions in fractional polynomials? The first step on p. 156 says to apply the FP algorithm to the predictors. Clear enough but in what cases does one include the continuous c

[R] Formatting numeric values in a data frame

2009-02-25 Thread Pele
Hi R users, I have a data frame that contains 10K obs and 200 variables where I am trying to format the numeric columns to look like the output table below (format to 2 decimal places) but I am having no luck.. Can someone tell me the best way to accomplist this? Thanks in advance for any he

Re: [R] Computing sd across an array with missing values

2009-02-25 Thread Jorge Ivan Velez
Dear Matt, You're absolutely right. The reason why my code gives different results is because it calculates the standard deviation for each row/column in all the arrays rather than for every cell. My bad. You can easily get the results you posted running >apply(p,1:2,sd,na.rm=TRUE) Here is anoth

[R] Problems with ARIMA models?

2009-02-25 Thread Marie Sivertsen
Dear R, I have find a website where they report problem with ARIMA models in R. I run the examples there and they give result as shown on the website. Does this mean that nothing has corrected in R? Maybe you not have seen the page, but the author said he contacted you. Here is the URL: http:/

Re: [R] Anova Help?

2009-02-25 Thread Tal Galili
Hi Dar. could you please specify what type of variables the dependent and independent variables are ? (numeric/ordered/categorical , what is their range) could you please specify how many dependent and independent variables you have ? (numeric/ordered/categorical , what is their range) In either

Re: [R] Gradient function for optim.

2009-02-25 Thread Katharine Mullen
see the fmingr function in src/main/optim.c (https://svn.r-project.org/R/trunk/src/main/optim.c) On Wed, 25 Feb 2009 rkevinbur...@charter.net wrote: > I have read that when the gradient function is not supplied (is null) > then first order differencing is used to find the differential. I was > tr

[R] R, joint scaling test, quantitative genetic analysis & sensitivity to model violations

2009-02-25 Thread Maureen Ryan
Hi all,This is really a stats question as much as an R question. I'm trying to do a joint scaling test (JST - see below) on some very oddly-distributed data and was wondering if anyone can suggest a good way of dealing with model violations and/or using R to evaluate how sensitive the model is

[R] make check reg-tests-1.R error on solaris

2009-02-25 Thread Karen Noel
R 2.5.1 compiled, passed the make check and has been successfully running for a couple years on a Sun Fire V490 running Solaris 9. I need a newer version of R, but can't get a newer version of R to pass the make check. I've tried 2.8.1, 2.7.2, 2.6.2 and 2.6.0. (2.5.1 still passes on this server) At

Re: [R] read and reshape time series table with empty items

2009-02-25 Thread Gabor Grothendieck
Try this: Lines <- '"Jahr";"Tag";"Jan";"Febr";"März";"April";"Mai";"Juni";"Juli";"Aug";"Sept";"Okt";"Nov";"Dez" 1978;1;"NA";"NA";"NA";0.0;5.5;0.0;11.8;0.0;2.4;6.4;0.0;0.0 1978;2;"NA";"NA";"NA";0.0;0.5;0.0;2.0;2.0;0.0;9.0;0.0;0.0 1978;3;"NA";"NA";"NA";0.3;0.0;3.0;3.2;0.4;0.0;24.7;0.0;0.0 1978;4;"N

Re: [R] Anova Help?

2009-02-25 Thread JLucke
Based on your description so far and on my making a reasonable set of assumptions that would still need to be checked, your analysis would appear to be a multivariate (connectedness, learning) analysis of covariance of a 5 (information exposure) by 3 (previous experience) design with 2 covari

Re: [R] biplot.princomp - changing score labels

2009-02-25 Thread stephen sefick
have you thought about extracting the data and using this in ggplot? On Wed, Feb 25, 2009 at 3:52 AM, Axel Strauß wrote: > Prof Brian Ripley schrieb: >> >> On Tue, 24 Feb 2009, Axel Strauß wrote: >> >>> OK, the one thing I figured out: >>> Is should be like: >>> biplot(test.pca, cex=c(2,1), col=c

Re: [R] biplot.princomp - changing score labels

2009-02-25 Thread Héctor Villalobos
Perhaps this may help you. Regards data(iris3) ir <- rbind(iris3[ , , 1], iris3[ , , 2], iris3[ , , 3]) ir.pca <- princomp(ir) biplot(ir.pca) # Rehacer Biplot # Calcular Factor para re-escalar scores y eigenvectores lambda <- ir.pca$sdev[1:2] * sqrt(ir.pca$n.obs) scores <- t( t(ir.

Re: [R] run latent class analysis with R

2009-02-25 Thread Drew Linzer
poLCA is designed to work this way. There's a complete user's guide and manual on the project website at http://userwww.service.emory.edu/~dlinzer/poLCA/ http://userwww.service.emory.edu/~dlinzer/poLCA/ Thanks, Drew == Drew Linzer Assistant Professor Department of Political Science Emory Uni

[R] Gradient function for optim.

2009-02-25 Thread rkevinburton
I have read that when the gradient function is not supplied (is null) then first order differencing is used to find the differential. I was trying to track down this for my own information but I run into .Internal(optim.). I was not sure where to look next to see the function that is automat

[R] make check reg-tests-1.R error on solaris

2009-02-25 Thread Karen Noel
R 2.5.1 compiled, passed the make check and has been successfully running for a couple years on a Sun Fire V490 running Solaris 9. I need a newer version of R, but can't get a newer version of R to pass the make check. I've tried 2.8.1, 2.7.2, 2.6.2 and 2.6.0. (2.5.1 still passes on this se

Re: [R] Anova Help?

2009-02-25 Thread Dar
I’m just setting up the experiment and need help explaining what the data analysis would be. Let me know of any questions….. what would be compared and how it would be measured. Is it a multi-way or 1-way anova? Thanks! A 5 X 1 between-subject design will be used for the experiment. Four tool gr

Re: [R] vertically aligned X axis labels disappear off R Graphics window

2009-02-25 Thread Uwe Ligges
R User R User wrote: Hi guys, I'm evaluating R for basic data exploration. I produce a bar plot of the data, with the x axis labels aligned vertically. However, the start of labels longer than about 10 characters are cut off by the bottom of the graphics window. I'd appreciate your help in pro

[R] monotonic GAM with more than one term

2009-02-25 Thread Benjamin Tyner
Hi, Does anyone know how to fit a GAM where one or more smooth terms are constrained to be monotonic, in the presence of "by" variables or other terms? I looked at the example in ?pcls but so far have not been able to adapt it to the case where there is more than one predictor. For example, requi

Re: [R] how to label the branches of a tree

2009-02-25 Thread David Winsemius
Following Dr Ripley's advice I looked at the text.rpart documentation a bit more thoroughly and after seeing "The edges connecting the nodes are labeled by left and right splits." I find that the fancy=TRUE invocation does cause a labeling of what you appear to be calling "branches". See

Re: [R] C-index for models fitted using start, stop in Surv?

2009-02-25 Thread Eleni Rapsomaniki
> rcorr.cens is not meant for that. Thank you for the clarification. On a second thought, I think (hope) a time-dependent AUC index should be more appropriate in this case, such as survivalROC. Many many thanks for all your help! Eleni Rapsomaniki Research Associate Tel: +44 (0) 1223 7402

Re: [R] multiple regressions on columns

2009-02-25 Thread Greg Snow
Well add1 (and others) does fit the regressions you asked about if you give it the base model only including the intercept and the scope including the x variables of interest. Unfortunately it only returns certain statistics on those models, not the whole object, but if you were interested in t

Re: [R] how to label the branches of a tree

2009-02-25 Thread David Winsemius
How do you want the labels to appear? Each branch will be the logical conjunction of the criteria for *all* of the upstream splits. Perhaps you can get direction by looking at the code of text.rpart: getAnywhere(text.rpart) Any split would need to add an "& Split-N yes" or an "& Split-N No"

Re: [R] C-index for models fitted using start, stop in Surv?

2009-02-25 Thread Frank E Harrell Jr
Eleni Rapsomaniki wrote: Dear R-users, One can use the rcorr.cens function in Design to compute the C index when only the stop time is indicated (I think implicitely start=0 in that case). When the start and stop times are used in a Surv object, e.g. library(Design) S=with(heart, Surv(start,s

[R] vertically aligned X axis labels disappear off R Graphics window

2009-02-25 Thread R User R User
Hi guys, I'm evaluating R for basic data exploration. I produce a bar plot of the data, with the x axis labels aligned vertically. However, the start of labels longer than about 10 characters are cut off by the bottom of the graphics window. I'd appreciate your help in properly spacing the space a

Re: [R] Computing sd across an array with missing values

2009-02-25 Thread Jorge Ivan Velez
Hi Mark, There is a typo in the first way. My apologies. It should be: # First res<-apply(p,3,function(X) c(scols=apply(X,2,sd,na.rm=TRUE),srows=apply(X,1,sd,na.rm=TRUE)) ) res HTH, Jorge On Wed, Feb 25, 2009 at 11:42 AM, Jorge Ivan Velez wrote: > > Dear Matt, > > Here are two w

Re: [R] All the products of common factors

2009-02-25 Thread Gordon Fox
Sorry - I didn't express myself very clearly. Yes, we're looking for common factors of A and B. One way to get there is by my initial approach: find the prime factors of each, select those that are in common, and then take pairwise products. My initial question was about the last step only. But

Re: [R] Using gregexpr with multiple search elements

2009-02-25 Thread Christos Hatzis
gregexpr("\\at|\\og", text) > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Corey Sparks > Sent: Wednesday, February 25, 2009 11:50 AM > To: R Help > Subject: [R] Using gregexpr with multiple search elements > > Dear list, >

[R] survival::survfit,plot.survfit

2009-02-25 Thread Jeff Xu
I am confused when trying the function survfit. my question is: what does the survival curve given by plot.survfit mean? is it the survival curve with different covariates at different points? or just the baseline survival curve? for example, I run the following code and get the survival curve

[R] Using gregexpr with multiple search elements

2009-02-25 Thread Corey Sparks
Dear list, I am trying to use gregexpr to see if entries in a dataframe have either of two possible values for a string. here's an example text<-c("fat", "rat", "cat", "dog", "log", "fish") If I just wanted to find if any one of the elements in text match the pattern "at" I would do gregexp

Re: [R] Computing sd across an array with missing values

2009-02-25 Thread Jorge Ivan Velez
Dear Matt, Here are two ways: # Data p <- array(c(1:5, rep(NA, times = 3)), dim = c(5, 5, 3)) # First res<-apply(p,3,function(X) c(scols=apply(X,2,sd,na.rm=TRUE),srows=apply(X,2,sd,na.rm=TRUE)) ) res # Second res2<-apply(p,3,function(X) list(scols=apply(X,2,sd,na.rm=TRUE),s

Re: [R] : record which entry in one file doesn't appear in a different file

2009-02-25 Thread Patrizio Frederic
hey Laura, I hope this help f1 = c("a","b","c") f2 = c("b","a","c","d") match(f2,f1) f3 = match(f2,f1,0) ?match cbind(f2,f3) cbind(f2,f3>0) f4 = ifelse(f3>0,"yes","no") cbind(f2,f4) data.frame(f2,f4) Patrizio 2009/2/25 Laura Rodriguez Murillo : > Hi dear list, > > If anybody could help me, it wo

Re: [R] Anova Help?

2009-02-25 Thread Tal Galili
Hi Dar. I am not sure I got your question - Are you asking what analysis to perform ? Or how to perform it ? Could you please give more details ? On Wed, Feb 25, 2009 at 5:52 PM, Dar wrote: > I am conducting an experiment where students are put into 5 total > groups (one is the control grou

[R] Anova Help?

2009-02-25 Thread Dar
I am conducting an experiment where students are put into 5 total groups (one is the control group). They are given a task and then I'm measuring if there are differences (A 5 X 1 between-subject design will be used for the experiment). I'm a little confused on the data explanation (or should I s

[R] Computing sd across an array with missing values

2009-02-25 Thread Matt Oliver
Dear help, suppose I have this array and want to compute sd aross rows and columns. p <- array(c(1:5, rep(NA, times = 3)), dim = c(5, 5, 3)) apply(p, 1:2, sd) fails because sd requires at least 2 numbers to compute sd apply(p, 1:2, sd, na.rm = TRUE) fails for the same reason I crafted my own fu

Re: [R] : record which entry in one file doesn't appear in a different file

2009-02-25 Thread Tal Galili
Hi Laura. Let's assume file 1 and 2 are vectors loaded in R named: vec1 and vec2, here is a short code (with dummy numbers) for a solution: vec1 <- c(1,2,34,4,3,6,76) vec2 <- c(1,2,34,76,24,62,1,4234,435,4333,4422,304,776) which.vec2.where.in.vec1 <- vec2 %in% vec1 which.vec2.where.in.vec1.t

[R] : record which entry in one file doesn't appear in a different file

2009-02-25 Thread Laura Rodriguez Murillo
Hi dear list, If anybody could help me, it would be great! I have two files: File 1 is a list (one column and around 10 rows) File 2 is a list with all the names from file one and a few more (one column and more than 10 rows) What I want is to add a column in file 2 that says which name

Re: [R] Have a function like the "_n_" in R ? (Automatic count function )

2009-02-25 Thread Gustaf Rydevik
On Wed, Feb 25, 2009 at 4:43 PM, Charles C. Berry wrote: > On Wed, 25 Feb 2009, Gustaf Rydevik wrote: > >> On Wed, Feb 25, 2009 at 3:30 PM, hadley wickham >> wrote: >>> >>> And for completeness here's a function that returns the next integer >>> on each call. >>> >>> n <- (function(){ >>>  i <- 0

Re: [R] How to get JRI to work from my NetBeans

2009-02-25 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
Did you set a system property for java.libary.path that points to the native library as the error message instructs? I'm not familiar with NetBeans, but in Eclipse you can set the JVM properties in a dialog. Otherwise you can always pass it in via the command line: -Djava.library.path= HTH, Brian

Re: [R] Help with Latex (Hmisc)

2009-02-25 Thread Marc Schwartz
on 02/25/2009 07:52 AM Frank E Harrell Jr wrote: > Dieter Menne wrote: >> Frank E Harrell Jr vanderbilt.edu> writes: >> >> ... Word and pdf >> >>> It depends on how you copy. By all means use Insert ... Picture ... >>> from file and directly insert pdf. >> >> Please, tell me how you got this to

Re: [R] Have a function like the "_n_" in R ? (Automatic count function )

2009-02-25 Thread Wacek Kusnierczyk
hadley wickham wrote: > On Wed, Feb 25, 2009 at 8:41 AM, Wacek Kusnierczyk > wrote: > >> hadley wickham wrote: >> >>> And for completeness here's a function that returns the next integer >>> on each call. >>> >>> n <- (function(){ >>> i <- 0 >>> function() { >>> i <<- i + 1 >>>

Re: [R] Linear Discriminant Analysis

2009-02-25 Thread Christos Hatzis
Maybe as a starter RSiteSearch("linear discriminant analysis") R has tools to help you help yourself with this types of questions. -Christos > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Arup > Sent: Wednesday, February

[R] Similarity between clusters generated by hclust + cutree

2009-02-25 Thread Corrado
Dear friends I have clustered some objects using the hclust algorithm, with method ward. I then cutree with 48 classes. distPredTurn<-as.dist(resultMatrix) hctr<-hclust(distPredTurn,"ward") cutree(hctr,k=NC) I would like to estimate the similarity between each pair of the 48 clusters, for exa

  1   2   >