[R] subset grouped data with quantile and NA's

2008-08-22 Thread David Carslaw
I can't quite seem to solve a problem subsetting a data frame. Here's a reproducible example. Given a data frame: dat <- data.frame(fac = rep(c("a", "b"), each = 100), value = c(rnorm(130), rep(NA, 70)), other = rnorm(200)) What I want is a new data frame (

[R] Parabolic cylinder function

2008-08-22 Thread Zornitsa Luleva
Dear all, I need your advice since I am looking for an implementation of the parabolic cylinder function in R. I found implemantations of the hypergemetric functions (the Whittaker and the confluent hypogeometric functions) in the package fAsianOptions but the parabolic cylinder function was unfor

Re: [R] GAM-binomial logit link

2008-08-22 Thread Fabrizio Cipollini
> Dear all, > > I'm using a binomial distribution with a logit link function to fit a GAM > model. I have 2 questions about it. > First i am not sure if i've chosen the most adequate distribution. I don't > have presence/absence data (0/1) but I do have a rate which values vary > between 0 and 1. T

[R] Censored Poisson Data

2008-08-22 Thread Justine Rochon
Dear list, I am wondering whether R allows to perform a Poisson regression on counting data which include censored observations, that is, observations of the form "2 events or more" or "less than 2 events" or even "1 or 2 events". Can anyone give me a hint whether this is already possible and

Re: [R] Simple look up

2008-08-22 Thread bartjoosen
Please take a look at the manuals before posting (DO read the posting guide!) Bart PS: yourdataframe[yourdataframe$TAZ==103,2] PDXRugger wrote: > > So i am hoping this solution is simple, which i beleive it is. I would > like to look up a value in one column of a data set and display the >

Re: [R] read.csv : double quoted numbers

2008-08-22 Thread Aval Sarri
On Thu, Aug 21, 2008 at 12:54 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > The problem is the commas, not the quotes: First thanks to everyone for taking out time to help me. As Mr. Gabor rightly corrected commas was my problem and not the double quotes (in numerical values). This solves

Re: [R] skipping values when reading binary files

2008-08-22 Thread Uwe Ligges
Pieter Beck wrote: Hi, I would like to skip a preset number of values when reading in a binary file (readBin). Is there any way to do this? See ?seek Uwe Ligges kind regards, and thanks in advance for the help. Pieter Beck [[alternative HTML version deleted]] __

Re: [R] skipping values when reading binary files

2008-08-22 Thread Philipp Pagel
> I would like to skip a preset number of values when reading in a binary file > (readBin). Is there any way to do this? Just read the number of elements you would like to skip and discard them. cu Philipp -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Technische Univ

Re: [R] barplot with anchored bars

2008-08-22 Thread Uwe Ligges
Paulo Barata wrote: Dear R list members, How to produce barplots anchored to the x-axis (not floating above the x-axis) with a box around? With both following codes, the lower horizontal line of the box is below the y = 0 line: # first code x <- c(1,2,3,4) barplot(x,yaxs='i') box() # secon

Re: [R] read.csv : double quoted numbers

2008-08-22 Thread Philipp Pagel
> gsub fails on this file due to a particular value "C￴te d'Ivoire" > which is present in the file. This is when my locale is set to > en_US.utf8 but when I set locale to C it (gsub) works. Have a look at ?file, especially the section on Encoding. cu Philipp -- Dr. Philipp Pagel Lehr

[R] chisq

2008-08-22 Thread Marco Chiapello
Hi, the chisq value for .05 level of signif. and 3 DF is 7.81 (one-sided). Is there a way to calculated it in R (giving level of signif. and DF)? Marco __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Help on competing risk package cmprsk with time dependent covariate

2008-08-22 Thread Philippe Guardiola
Dear R users, I d like to assess the effect of "treatment" covariate on a disease relapse risk with the package cmprsk. However, the effect of this covariate on survival is time-dependent (assessed with cox.zph): no significant effect during the first year of follow-up, then after 1 year a fa

Re: [R] GAM-binomial logit link

2008-08-22 Thread cipollin
> Dear all, > > I'm using a binomial distribution with a logit link function to fit a GAM > model. I have 2 questions about it. > First i am not sure if i've chosen the most adequate distribution. I don't > have presence/absence data (0/1) but I do have a rate which values vary > between 0 and 1.

[R] Retrieving sample points

2008-08-22 Thread Yemi Oyeyemi
Hi everyone. My problem is about multivariate analysis. Given a multivariate data X, of dimension (n by p), n is the number of observations while p is the number of variables. I wanted a sample of size p+1 that will have its product of the eigen values of the covariance matrix to be the minimum

Re: [R] chisq

2008-08-22 Thread Ted Harding
On 22-Aug-08 08:19:15, Marco Chiapello wrote: > Hi, > the chisq value for .05 level of signif. and 3 DF is 7.81 (one-sided). > Is there a way to calculated it in R (giving level of signif. and DF)? > > Marco qchisq(0.95,df=3) # [1] 7.814728 qchisq(0.05,df=3,lower.tail=FALSE) # [1] 7.814728 T

Re: [R] psychometric functions

2008-08-22 Thread Mario Maiworm
Paul, thanks a lot for your advice! I got that kuss et al. paper and started to read, this is more than I had expected! Very cool paper, and an algorithm implemented in R that seems to be even superior to psignifit in matlab. So thanks again! mario

[R] swap

2008-08-22 Thread amor Gandhi
Hello everybody,   I wonder if there is any swap function in R that does the following: x <- seq(1,10,12) x1 <- swap(x) x1 1 8 3 4 5 6 7 2 10 Thank you very much!   Amor __ Schutz gegen Massenmails. [[alternative HTML version deleted]

Re: [R] Very confused with class

2008-08-22 Thread Dan Davison
Hi Rich, Richard M. Heiberger wrote: > > Dan, > > The real problem is the use of csv files. csv files don't handle missing > values > ("#VALUE" is most likely from Excel), dates, or other complications very > well. > > Read your Excel file directly into > R with one of the packages designed

Re: [R] Help on competing risk package cmprsk with time dependent covariate

2008-08-22 Thread Arthur Allignol
Hello, Something i don't understand in your question. Is treatment a time-dependent covariate? That is, do patients receive the treatment at the beginning of the study or later? cmprsk cannot handle time-dependent covariates. But if treatment is a baseline covariate, but has a time-varying effe

Re: [R] swap

2008-08-22 Thread Richard . Cotton
> I wonder if there is any swap function in R that does the following: > x <- seq(1,10,12) This just makes x equal to 1. I'm guessing you meant something like x <- 1:10 > x1 <- swap(x) > x1 > 1 8 3 4 5 6 7 2 10 It's not terribly clear what you want swap to do. You can reorder the elements of

[R] Coordinate systems for geostatistics in R

2008-08-22 Thread imicola
Hi, I read somewhere that when carrying out geostatistical analysis in R you should not use latitude and longitude...can anyone expand on this a little for me, and what would be the best coordinate system to use? I have my data in a geographic coordinate system, WGS84, decimal degreesis this

Re: [R] Large data sets with R (binding to hadoop available?)

2008-08-22 Thread Rory.WINSTON
Hi Apart from database interfaces such as sqldf which Gabor has mentioned, there are also packages specifically for handling large data: see the "ff" package, for instance. I am currently playing with parallelizing R computations via Hadoop. I haven't looked at PIG yet though. Rory -Ori

Re: [R] call perl

2008-08-22 Thread Rory.WINSTON
Maybe ?system Might be what you need here? -Rory -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jay an Sent: 22 August 2008 03:08 To: r-help@r-project.org Subject: [R] call perl Hi, It may be the old question. can anyone tell me how to call perl in

Re: [R] help needed for HWE.exact in library "genetics"

2008-08-22 Thread Neil Shephard
You could follow the advice given when loading the library (see the code you posted for details) and use the enhanced genetics packages to cross-validate the results (ideally you should get the same answer). The results not weird though. Your working with SNPs and having a homozygote with a freq

[R] Bias reduction method

2008-08-22 Thread Julio Rojas
Dear all, I'm doing a simulation study for an MM1 queue and I would like to know if there are bias correction methods in R for time series (estimations of warm-up points or something else). Hope you can help me. __

Re: [R] barplot with anchored bars

2008-08-22 Thread Jim Lemon
On Thu, 2008-08-21 at 15:47 -0300, Paulo Barata wrote: > Dear R list members, > > How to produce barplots anchored to the x-axis (not floating > above the x-axis) with a box around? > > With both following codes, the lower horizontal line of the > box is below the y = 0 line: > > # first code >

[R] simple generation of artificial data with defined features

2008-08-22 Thread drflxms
Dear R-colleagues, I am quite a newbie to R fighting my stupidity to solve a probably quite simple problem of generating artificial data with defined features. I am conducting a study of inter-observer-agreement in child-bronchoscopy. One of the most important measures is Kappa according to Fleis

[R] random effects in lmer

2008-08-22 Thread Line Johansen
Dear all<> I am running several generalized mixed model using lmer. <>The models typical look like this: model2xx<-lmer(numbers~Treatment+b+(1|Genotype)+(1|Field)+(1|Genotype:Treatment), family=quasipoisson)<> All factors are categorical. <>And the output looks like this: Generalized linear

Re: [R] subset grouped data with quantile and NA's

2008-08-22 Thread jim holtman
This will also remove the NAs from the output; you will have to change it to also keep the NAs. Wasn't sure what you wanted to do with them. dat <- data.frame(fac = rep(c("a", "b"), each = 100), value = c(rnorm(130), rep(NA, 70)), other = rnorm(200)) # split the

Re: [R] Coordinate systems for geostatistics in R

2008-08-22 Thread Rubén Roa-Ureta
imicola wrote: Hi, I read somewhere that when carrying out geostatistical analysis in R you should not use latitude and longitude...can anyone expand on this a little for me, and what would be the best coordinate system to use? Not only in R. In most systems, the inter-point distances are ass

Re: [R] Combining multiple datasets

2008-08-22 Thread jim holtman
Here is the way that I usually do it using lapply: myData <- lapply(list.files(pattern=".RWL$"), function(.file) read.rel(.file, header=TRUE)) # combine into a single dataframe myDF <- do.call(rbind, myData) On Thu, Aug 21, 2008 at 10:42 PM, Alison Macalady <[EMAIL PROTECTED]> wrote: > Hi, > I'

[R] nesting environments

2008-08-22 Thread Antje
Hello, I got the hint to use nesting environments (for a GUI problem), but I'm not sure whether I understand what he means (and I did not really succeed with reading documentation - probably I looked for the wrong keywords?). That's what he wrote: > Another good way to control the scoping is

[R] swap

2008-08-22 Thread amor Gandhi
Hello Richie, I would like to do three (or k) swap steps in each step just 2 ID recursive swaping x <- 1:10 swap <- function(x){   a <- sample(x,2)   x[x==a[1]] <- swap[2]   x[x==a[2]] <- swap[1]   return(x)   }   swap(swap(swap(x))) -> mix   Is this possible? Thanks you in advance! Amor

[R] Re : Help on competing risk package cmprsk with time dependent covariate

2008-08-22 Thread phguardiol
Hello again, I m trying to use timereg package as suggested (R2.7.1 on XP Pro). here is my script based on the example from timereg for a fine & gray model in which relt = time to event, rels = status 0/1/2 2=competing, 1=event of interest, 0=censored random = covariate I want to test   libr

Re: [R] swap

2008-08-22 Thread jim holtman
Is this what you want: > swap <- function(z){ + a <- sample(length(z), 2) + z[a] <- z[rev(a)] + z + } > swap(1:10) [1] 2 1 3 4 5 6 7 8 9 10 > > swap(1:10) [1] 5 2 3 4 1 6 7 8 9 10 > swap(1:10) [1] 8 2 3 4 5 6 7 1 9 10 > swap(1:10) [1] 2 1 3 4 5 6 7

Re: [R] nesting environments

2008-08-22 Thread Gabor Grothendieck
Look at the example section of ?new.env Also the proto package on CRAN defines proto objects (which are just environments with slightly different semantics) and in the Applications section of the home page has links to examples of using proto objects to creates GUIs with gWidgets: http://r-proto.g

Re: [R] nesting environments

2008-08-22 Thread Antje
Thanks a lot! I'll give it a closer look :-) Ciao, Antje Gabor Grothendieck schrieb: Look at the example section of ?new.env Also the proto package on CRAN defines proto objects (which are just environments with slightly different semantics) and in the Applications section of the home page h

Re: [R] Coordinate systems for geostatistics in R

2008-08-22 Thread Paul Hiemstra
imicola schreef: Hi, I read somewhere that when carrying out geostatistical analysis in R you should not use latitude and longitude...can anyone expand on this a little for me, and what would be the best coordinate system to use? I have my data in a geographic coordinate system, WGS84, decimal

Re: [R] swap

2008-08-22 Thread Richard . Cotton
> Hello Richie, > I would like to do three (or k) swap steps in each step just 2 ID > recursive swaping > x <- 1:10 > swap <- function(x){ > a <- sample(x,2) > x[x==a[1]] <- swap[2] > x[x==a[2]] <- swap[1] > return(x) > } > swap(swap(swap(x))) -> mix I tried my best with a response be

[R] How to read malformed csv files with read.table?

2008-08-22 Thread Martin Ballaschk
Hi, how do I read files that have two header fields less than they have columns? The easiest solution would be to insert one or two additional header fields, but I have a lot of files and that would be quite a lot of awful work. Any ideas on how to solve that problem? ### R stuff: >

[R] Re : Help on competing risk package cmprsk with time dependent covariate

2008-08-22 Thread Philippe Guardiola
Hello again, I m trying to use timereg package as you suggested (R2.7.1 on XP Pro). here is my script based on the example from timereg for a fine & gray model in which relt = time to event, rels = status 0/1/2 2=competing, 1=event of interest, 0=censored random = covariate I want to test lib

[R] draw a function over a histogram

2008-08-22 Thread Daniela Garavaglia
Sorry, I have some troubles with the graph device. How can I draw a function over a histogram? Thank's so much. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

[R] mapping a vector into predefined bins

2008-08-22 Thread Dr. G. Lawyer
Hi, I have a mapping M consisting of a vector of bin centers (say 0.01, 0.02, 0.03 ..., 1) with associated values (say "red", "orange", "yellow", ...), stored as a 2-column matrix with column 1 the bin center and column 2 the value. I also have a vector D of data (say 0.9056, 0.4

[R] filtering out data

2008-08-22 Thread Kate Rohrbaugh
Greetings, Apologies for such a simple question, but I have been trying to figure this out for a few days now (I'm quite new to R), have read manuals, list posts, etc., and not finding precisely what I need. I am accustomed to working in Stata, but I am currently working through the multileve

[R] filtering out data

2008-08-22 Thread Kate Rohrbaugh
Greetings, Apologies for such a simple question, but I have been trying to figure this out for a few days now (I'm quite new to R), have read manuals, list posts, etc., and not finding precisely what I need. I am accustomed to working in Stata, but I am currently working through the multileve

Re: [R] draw a function over a histogram

2008-08-22 Thread Rubén Roa-Ureta
Daniela Garavaglia wrote: Sorry, I have some troubles with the graph device. How can I draw a function over a histogram? Thank's so much. Daniela, What function? Here is one example using density() and using dnorm() x <- rnorm(1000,2,2) hist(x,prob=TRUE) lines(density(x,na.rm=TRUE),col="red

Re: [R] How to read malformed csv files with read.table?

2008-08-22 Thread jim holtman
Try this. It will read the file and see if there is a difference and add in the extra headers: x <- " time/ms C550.KMSCyt_b559.KMSCyt_b563.KMS Cyt_f_.KMS P515FR.KMS Scatt.KMS Zea2.KMSPC P700 0 Point1 -599.500 0.000 0.000 0.

Re: [R] How to read malformed csv files with read.table?

2008-08-22 Thread Daniel Folkinshteyn
on 08/22/2008 10:19 AM Martin Ballaschk said the following: how do I read files that have two header fields less than they have columns? The easiest solution would be to insert one or two additional header fields, but I have a lot of files and that would be quite a lot of awful work. Any idea

Re: [R] filtering out data

2008-08-22 Thread jim holtman
Exactly what do you want this statement to do: if(merged.dataset$model1 == 1) model1.coeff <- lm(dv ~ iv1 + iv2 + iv3, data = merged.dataset) The result in the "if" is a vector of logical values (assuming that merged.dataset is longer than 1); that is the source of the error message. Do you want

[R] testing for differences in sums - how to?

2008-08-22 Thread James Howey
If I want to test for a salesman effect on average sale, I model it as "Sale ~ Salesman". But what if I want to test for a salesman effect on total sales? How do I model that? Given a significant salesman effect, how do I follow up with the equivalent of Tukey's HSD to determine who the (indist

Re: [R] How to read malformed csv files with read.table?

2008-08-22 Thread Prof Brian Ripley
On Fri, 22 Aug 2008, Daniel Folkinshteyn wrote: on 08/22/2008 10:19 AM Martin Ballaschk said the following: how do I read files that have two header fields less than they have columns? The easiest solution would be to insert one or two additional header fields, but I have a lot of files and th

[R] Test of Homogeneity of Variances

2008-08-22 Thread Daren Tan
I am testing the homogeneity of variances via bartlett.test and fligner.test. Using the following example, how should I interpret the p-value in order to accept or reject the null hypothesis ? set.seed(5) x <- rnorm(20) bartlett.test(x, rep(1:5, each=4)) Bartlett test of homogeneity o

[R] cross validation for lme?

2008-08-22 Thread Mark Na
Hello, We would like to perform a cross validation on linear mixed models (lme) and wonder if anyone knows of something analogous to cv.glm for such models? Thanks, Mark [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] HELP: how to add weight to a [x,y] coordinate

2008-08-22 Thread Greg Snow
There are several options. You can use the sunflowerplot function. You can plot solid points with a small alpha value (not all graphics devices support this), so that just a few points show up pale, but a lot show up as more opaque. You can use the symbols function (or bubbleplot, or my.symbol

Re: [R] Test of Homogeneity of Variances

2008-08-22 Thread Richardson, Patrick
What are your hypotheses? Once you state what they are, interpretation should be straightforward. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daren Tan Sent: Friday, August 22, 2008 11:18 AM To: [EMAIL PROTECTED] Subject: [R] Test of Homogeneity of

[R] lme questions re: repeated measures & covariance structure

2008-08-22 Thread Mark Na
Hello, We are attempting to use nlme to fit a linear mixed model to explain bird abundance as a function of habitat: lme(abundance~habitat-1,data=data,method="ML",random=~1|sampleunit) The data consist of repeated counts of birds in sample units across multiple years, and we have two questions:

Re: [R] Null and Alternate hypothesis for Significance test

2008-08-22 Thread Greg Snow
The problem with trying to prove that 2 distributions are equal is that there is exactly one way in which they can be equal and an infinite number of ways that they can be different (and its rather a large infinity). The traditional use of equality as the Null hypothesis works, because we can a

Re: [R] swap

2008-08-22 Thread Patrick Burns
I'm guessing that the following (untested) does what is wanted: function(x) { pos <- sample(length(x), 2, replace=FALSE) x[pos] <- x[ pos[2:1] ] x } Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User")

Re: [R] lme questions re: repeated measures & covariance structure

2008-08-22 Thread Christoph Scherber
Dear Mark, I would include the repeated measure as the smallest stratum in the random effects specification: random=~1|sampleunit/year Setting up user-defined variance structures should be possible using for example: weights=varPower(form=~habitat) or also try out the available corStruct()

Re: [R] mapping a vector into predefined bins

2008-08-22 Thread Wolfgang Huber
Have a look at ? cut Best wishes Wolfgang -- Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber 22/08/2008 14:14 Dr. G. Lawyer scripsit >Hi, >I have a mapping M consisting of a vector of bin centers

Re: [R] filtering out data

2008-08-22 Thread Daniel Folkinshteyn
If I understand correctly the result you are trying to achieve, I think what you may be looking for is this: model1.coeff <- lm(dv ~ iv1 + iv2 + iv3, data = merged.dataset[merged.dataset$model1 == 1, ]) This will give you a regression using only the data for which model1 == 1. on 08/22/2008

Re: [R] Test of Homogeneity of Variances

2008-08-22 Thread Daren Tan
I am testing whether the sample variances are equal. When p-value < 0.05 (alpha), should accept null hypothesis (sample variances are equal) or reject it ? The two new examples with each having same sample variances also puzzle me. Why are the p-values different ? bartlett.test(rep(rnorm(5),

Re: [R] Large data sets with R (binding to hadoop available?)

2008-08-22 Thread Thomas Lumley
On Thu, 21 Aug 2008, Roland Rau wrote: Hi Avram Aelony wrote: (in part) 1. How do others handle situations of large data sets (gigabytes, terabytes) for analysis in R ? I usually try to store the data in an SQLite database and interface via functions from the packages RSQLite (and DBI).

[R] boxplot

2008-08-22 Thread Suyan Tian
Hi, I just made a boxplot but I want to change the thickness of the line used for the median to look a little thinner. Could anyone please help me figuring out the R-code to do it? Thanks, I really appreciate it. Suyan __ R-help@r-project.org mail

Re: [R] Large data sets with R (binding to hadoop available?)

2008-08-22 Thread Martin Morgan
Hi Avram -- My understanding is that Google-like map / reduce achieves throughput by coordinating distributed calculation with distributed data. snow, Rmpi, nws, etc provide a way of distributing calculations, but don't help with coordinating distributed calculation with distributed data. SQL (a

Re: [R] filtering out data

2008-08-22 Thread Thomas Lumley
On Fri, 22 Aug 2008, Kate Rohrbaugh wrote: Greetings, Apologies for such a simple question, but I have been trying to figure this out for a few days now (I'm quite new to R), have read manuals, list posts, etc., and not finding precisely what I need. I am accustomed to working in Stata, but

Re: [R] call perl

2008-08-22 Thread Greg Snow
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jay an > Sent: Thursday, August 21, 2008 8:08 PM > To: r-help@r-project.org > Subject: [R] call perl > > Hi, > > It may be the old question. > can anyone tell me how to call perl in R? > # call perl i

Re: [R] boxplot

2008-08-22 Thread jim holtman
Try this: it came from the help on 'bxp' which is called from boxplot: boxplot(count ~ spray, data = InsectSprays, col = "lightgray",medlwd=1) On Fri, Aug 22, 2008 at 3:18 PM, Suyan Tian <[EMAIL PROTECTED]> wrote: > Hi, I just made a boxplot but I want to change the thickness of the line > used

Re: [R] simple generation of artificial data with defined features

2008-08-22 Thread Greg Snow
I don't think that the election data is the right data to demonstrate Kappa, you need subjects that are classified by 2 or more different raters/methods. The election data could be considered classifying the voters into which party they voted for, but you only have 1 rater. Maybe if you had so

Re: [R] filtering out data

2008-08-22 Thread Kate Rohrbaugh
Thank you, thank you everyone! This last worked the best for what I need to do. The other options were definitely helpful in that they help me understand how R is structured (something I haven't been able to get my head around yet) and gave me good ideas about how to manipulate data, however

[R] WinBUGS with R

2008-08-22 Thread artimon
Dear Users, I am new to both of things, so do not blame me too much... I am busy with semiparametric regression and use WinBUGS to sample posteriors. The code to call Winbugs is as follows: data<- list("y","X","n","m") #My variables inits.beta <- rep(0,K) inits.beta0 <- 0 i

Re: [R] Combining multiple datasets

2008-08-22 Thread bogdan romocea
Here's a function that does what you asked, you may need to adjust the column names of your data frames before using it. If all your data frames are similar (same number of rows, same years) then try do.call('cbind', yourList). #This function takes a list of data frames and merges them into one

Re: [R] Quantile regression with complex survey data

2008-08-22 Thread Brian S Cade
Just as a follow-up on T. Lumley's post, 2 citations that may be useful in reference to application of quantile regression with survey samples are: Bassett and Saleh. 1994. L_1 estimation of the median of a survey population. Nonparametric Statistics 3: 277-283. (L_1 estimation of median is

[R] grep, gsub and metacharacters

2008-08-22 Thread Judith Flores
Hello, I have an expression that I want to substitute for something else. myvector<-c("ajkhfkiuwe","Variable(kg/min)") if I use the following code to extract "variable(kg/min)" and substitute it for "va" gsub(myvector[grep("var", myvector, ignore=T)], "va", myvector) grep identifies the e

Re: [R] Survey Design / Rake questions

2008-08-22 Thread Farley, Robert
I *think* I'm making progress, but I'm still failing at the same step. My rake call fails with: Error in postStratify.survey.design(design, strata[[i]], population.margins[[i]], : Stratifying variables don't match To my naïve eyes, it seems that my factors are "in the wrong order". If so,

Re: [R] WinBUGS with R

2008-08-22 Thread Uwe Ligges
artimon wrote: Dear Users, I am new to both of things, so do not blame me too much... I am busy with semiparametric regression and use WinBUGS to sample posteriors. The code to call Winbugs is as follows: data<- list("y","X","n","m") #My variables inits.beta <- rep(0,K) ini

Re: [R] How to read malformed csv files with read.table?

2008-08-22 Thread Martin Ballaschk
Hi folks, thank you for your friendly and immediate help! Am 22.08.2008 um 17:14 schrieb Prof Brian Ripley: Or, better, use header=FALSE, skip=1 and the col.names arg of read.table(). My solution is reading the files without the headers (skip = 1) and seperately reading the headers with sc

Re: [R] grep, gsub and metacharacters

2008-08-22 Thread Greg Snow
Try this: > myvector<-c("ajkhfkiuwe","Variable(kg/min)") > gsub( "\\(kg/min\\)", "va", myvector ) Does that come close to what you want? If not, maybe an example of what you want the result to look like, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PR

Re: [R] How to read malformed csv files with read.table?

2008-08-22 Thread Prof Brian Ripley
On Fri, 22 Aug 2008, Martin Ballaschk wrote: Hi folks, thank you for your friendly and immediate help! Am 22.08.2008 um 17:14 schrieb Prof Brian Ripley: Or, better, use header=FALSE, skip=1 and the col.names arg of read.table(). My solution is reading the files without the headers (skip = 1

Re: [R] simple generation of artificial data with defined features

2008-08-22 Thread Christos Hatzis
On the general question on how to create a dataset that matches the frequencies in a table, function as.data.frame can be useful. It takes as argument an object of a class 'table' and returns a data frame of frequencies. Consider for example table 6.1 of Fleiss et al (3rd Ed): > birth.weight <-

Re: [R] How to read malformed csv files with read.table?

2008-08-22 Thread Martin Ballaschk
Hi Brian, Am 22.08.2008 um 19:22 schrieb Prof Brian Ripley: On Fri, 22 Aug 2008, Martin Ballaschk wrote: My solution is reading the files without the headers (skip = 1) and seperately reading the headers with scan (scan("myfile.CSV", what = "character", sep = "\t", nlines = 1). After throw

Re: [R] Test of Homogeneity of Variances

2008-08-22 Thread Mark Difford
Have you read the documentation to either of the functions you are using? ?bartlett.test "Performs Bartlett's test of the null that the variances in each of the groups (samples) are the same." This explicitly tells you what is being tested, i.e. the null tested is that var1 = var2. ?rnorm G

Re: [R] Test of Homogeneity of Variances

2008-08-22 Thread Liaw, Andy
You don't need to test that the _sample_ variances are different: They already are. Statistical tests of hypotheses are not about sample statistics, but distributional charateristics. It seems to me that reinforcement of some basic stat concept may do you quite a bit of good. If you don't have

[R] inner margins for lattice

2008-08-22 Thread Todd Hatfield
I would like to control the inner margins of a lattice graph. The graph is a single superposed panel, but there is too much white space around the data for my liking. I've played around with some of the layout options, but so far have found only how to control outer margins. R version 2.7.1 (200

[R] R and GNUPLOT

2008-08-22 Thread Fristachi, Anthony
Hello, I am trying to send commands to GNUPLOT to load a .plt file that was generated with a C++ software module called with R, and to replot. I am able to open the program with shell.exec (below) but I am at a loss at what do next. Any suggestions?? shell.exec("C:\\ gnuplot \\ bin \\ wgnu

Re: [R] R and GNUPLOT

2008-08-22 Thread Greg Snow
There are some interface commands in the TeachingDemos package (see ?gp.open) for communicating between R and Gnuplot. These commands are pretty basic, but looking at the code may give you some ideas of what to do next in your project (or maybe what not to do). Hope this helps, -- Gregory (Gr

[R] Sending "..." to a C external

2008-08-22 Thread John Tillinghast
I'm trying to figure this out with "Writing R Extensions" but there's not a lot of detail on this issue. I want to write a (very simple really) C external that will be able to take "..." as an argument. (It's for optimizing a function that may have several parameters besides the ones being optimize

Re: [R] lme questions re: repeated measures & covariance structure

2008-08-22 Thread Mark Na
Great, thanks for your reply! I've just tracked down a copy of Pinheiro & Bates (2000) so I'll look at that, too. Thanks again, Mark On Fri, Aug 22, 2008 at 9:56 AM, Christoph Scherber < [EMAIL PROTECTED]> wrote: > Dear Mark, > > I would include the repeated measure as the smallest stratum in

[R] sd(NA)

2008-08-22 Thread Roy Mendelssohn
Hi All: This was discussed in the R-developers list (see the thread starting at http://tolstoy.newcastle.edu.au/R/e3/devel/ 07/12/0560.html). It has to do with the behavior of sd() when the entire vector is NA. The behavior has changed between 2.6 and 2.7.1 as follows: Run in Version

Re: [R] sd(NA)

2008-08-22 Thread hadley wickham
Here's one approach: try_default <- function(expr, default = NA, quiet = FALSE) { result <- default if (quiet) { tryCatch(result <- expr, error = function(e) {}) } else { try(result <- expr) } result } failwith <- function(default = NULL, f, quiet = FALSE) { function(...) try_

Re: [R] Writing Rcmdr Plugins

2008-08-22 Thread Richard M. Heiberger
Bernhard and Irina, While tailoring the Rcmdr menu directly does work, I strongly do not recommend it. It will lead to mass confusion, most likely for the author, several months from now when it is installed on a different machine or when R or Rcmdr is updated. It is much cleaner to have a sepa

Re: [R] History pruning

2008-08-22 Thread Richard M. Heiberger
We have different starting points. Please be sure that your modularity allows a cleaned region as well as a history log to be the input to your next step. The history log is incomplete; lines sent to the *R* buffer by C-c C-n are explicitly excluded from history. Lines picked up from a saved tra

[R] Building colorspace on RHEL5

2008-08-22 Thread hadley wickham
Dear all, I'm having problems installing the colorspace package on Red Hat Enterprise Linux 5: * Installing *source* package 'colorspace' ... ** libs gcc -std=gnu99 -I/usr/lib/R/include -I/usr/lib/R/include -I/usr/local/include-fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fs

Re: [R] Building colorspace on RHEL5

2008-08-22 Thread Marc Schwartz
Hi Hadley, on 08/22/2008 03:52 PM hadley wickham wrote: > Dear all, > > I'm having problems installing the colorspace package on Red Hat > Enterprise Linux 5: > > * Installing *source* package 'colorspace' ... > ** libs > gcc -std=gnu99 -I/usr/lib/R/include -I/usr/lib/R/include > -I/usr/local/in

[R] Newbie programming help

2008-08-22 Thread Ranney, Steven
All - Not sure if this is a real programming question, but here goes: I have data that looks like LakeLength Weight 1 158 45 1 179 70 1 200 125 1 202 150 1 206 145 1 209 165 1 210 140 1 215 175 1 216

Re: [R] help needed for HWE.exact in library "genetics"

2008-08-22 Thread David Duffy
"Sun, Ying" asked: I have a genotype data for both case and controls and would like to calculate the HW p-value. However, since the number of one genotype is 0, I got wierd result. Would someone help me to figure it out? Or confirm it's right? Thanks a lot. ... HWE.exact(g1) Exact Test

Re: [R] Newbie programming help

2008-08-22 Thread Chuck Cleland
On 8/22/2008 5:34 PM, Ranney, Steven wrote: > All - > > Not sure if this is a real programming question, but here goes: > > I have data that looks like > > Lake Length Weight > 1 158 45 > 1 179 70 > 1 200 125 > 1 202 150 > 1 206 145 > 1 209 165

[R] Using interactive plots to get information about data points

2008-08-22 Thread jcarmichael
I have been experimenting with interactive packages such iplots and playwith. Consider the following sample dataset: A B C D 1 5 5 9 3 2 8 4 1 7 3 0 7 2 2 6 Let's say I make a plot of variable A. I would like to be able to click on a data point (e.g. 3) and have a pop-up window

[R] How to handle "~" character after csv importation

2008-08-22 Thread Sébastien
Dear R users, I have to import some csv files in which column headers contain the character "~". Following the following import call, the character seems to be replaced by dots in the column names of my data frame. Plus, I cannot query names(mydata) to find the column index which header should

[R] dimension values of an array

2008-08-22 Thread Jan Akko Eleveld
Question: I created an array with 164 columns and 70 rows. I would like every column to have unit value 1 and the rows 0.1, 0.2, 0.3 up to 7. How can I define that? Thanks for your help! Good weekend! Akko _ [[a

  1   2   >