Re: [R] bigglm() results different from glm()

2009-07-03 Thread Greg Snow
I don't know why the AIC is different, but remember that there are multiple definitions for AIC (generally differing in the constant added) and it may just be a difference in the constant, or it could be that you have not fit the whole dataset (based on your other question). For an lm model big

Re: [R] Histogram

2009-07-03 Thread Greg Snow
I addition to the other responses you have received, you may want to play with the run.hist.demo function in the TeachingDemos package to learn more. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- >

Re: [R] bigglm() results different from glm()+Another question

2009-07-06 Thread Greg Snow
Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: utkarshsinghal [mailto:utkarsh.sing...@global-analytics.com] Sent: Monday, July 06, 2009 8:58 AM To: Thomas Lumley; Greg Snow Cc: r help Subject: Re: [R] bigglm() results different from glm()+Another question The AIC of the biglm models is

Re: [R] drawing an axis using axis command

2009-07-06 Thread Greg Snow
If the structure is your xx variable, then you are creating a plot that goes from 1911 to 2006 (plus a little to either side), then asking the axis function to draw and label an axis from 1 to 11, which is very far off the plotting device to the left. Try giving the axis function a list of valu

Re: [R] bigglm() results different from glm()+Another question

2009-07-07 Thread Greg Snow
code. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: utkarshsinghal [mailto:utkarsh.sing...@global-analytics.com] Sent: Tuesday, July 07, 2009 12:10 AM To: Greg Snow Cc: Thomas Lumley; r help Subject: Re: [R]

Re: [R] Uncorrelated random vectors

2009-07-07 Thread Greg Snow
Here are some examples that may get you started (note that there is no guarantee that a variable follows a given distribution after it has been adjusted to have 0 correlation with another variable): library(MASS) tmp <- mvrnorm(25, c(0,0), diag(2), empirical=TRUE) zapsmall(cor(tmp)) tmp2 <- exp

Re: [R] vectorizing a function

2009-07-07 Thread Greg Snow
For this case it is quite simple, see ?ifelse > z <- ifelse( x > 0, y, -y ) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun.

Re: [R] Uncorrelated random vectors

2009-07-08 Thread Greg Snow
The mvrnorm function in the MASS package has an argument to force the generated data to have the exact mean/variance structure as specified which when used with a diagonal variance matrix will generate data that has a 0 (within round off error) correlation in the data. No post processing by Gra

Re: [R] bigglm() results different from glm()+Another question

2009-07-08 Thread Greg Snow
lps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: utkarshsinghal [mailto:utkarsh.sing...@global-analytics.com] Sent: Wednesday, July 08, 2009 2:24 AM To: Greg Snow Cc: Thomas Lumley; r help Subject: Re: [R] bigglm() result

Re: [R] Two-way ANOVA gives different results using anova(lm()) than doing it by hand

2009-07-08 Thread Greg Snow
Well, since we don't have Data.txt it is kind of hard for us to replicate what you have done. Here goes a guess as to what the problem may be. Have you told R anywhere that S1 and S2 are factors with 6 levels rather than numeric vectors? Or are you just hoping that the computer can read your mi

Re: [R] Randomizing a dataframe

2009-07-08 Thread Greg Snow
Here is one approach (there are others, some that are probably better, but this can get you started): 1. rearrange your data so that every insect is a single row with 2 columns: the tree id and the species (this new dataset will have as many rows as the sum of the values in the old dataset). T

Re: [R] print() to file?

2009-07-08 Thread Greg Snow
?sink -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Steve Jaffe > Sent: Wednesday, July 08, 2009 1:03 PM >

Re: [R] drawing hmms

2009-07-11 Thread Greg Snow
Look at the subplot function in the TeachingDemos package. Does that do what you want? From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of rajesh j [akshay.raj...@gmail.com] Sent: Friday, July 10, 2009 2:04 AM To: milton ruser

Re: [R] problems with contrast matrix

2009-07-14 Thread Greg Snow
Your contrasts are not linearly independent and therefore there are an infinite number of possible correct answers, this tends to confuse computers (take 1/3 times the 3rd col, plus 2/3 times the 4th col, plus 3/3 times the 5th col and compare that to the 1st col). You need to replace one of th

Re: [R] plotting confidence intervals

2009-07-15 Thread Greg Snow
I believe there is a set of options in the ggplot2 package that will create a plot and add the confidence region to it, you will need to look at the documentation for ggplot2, I don't know the details (have not made it that far on my to do list, not anything against the package). -- Gregory (G

Re: [R] Proper Paste for Data Member

2009-07-15 Thread Greg Snow
The dollar sign ($) is a magical shortcut for the [[ subset operator (yes the doubling is intentional) for accessing parts of lists/data frames/etc. When you try to use magical shortcuts for purposes beyond what they were designed for, you get the computer equivalent of turning yourself into a

Re: [R] Comprehensive power analysis/sample size package in R?

2009-07-15 Thread Greg Snow
I don't know of a single package that is comparable to PASS, but the R system itself is the most comprehensive tool available for power and sample size computations. For the simple cases you already found the pwr package, there are also some power functions in the stats package and in some othe

Re: [R] Axes origins and labeling

2009-07-15 Thread Greg Snow
Look at the box function, or use xaxt='n' and/or yaxt='n' rather than axes=FALSE. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] axis label config mgp

2009-07-16 Thread Greg Snow
Leave the mgp setting alone and use xlab='' when you create the original plot. This will put the y-label in the usual place and not create the x-label. Then use the "title" or "mtext" function to place the x label where you want it. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistic

Re: [R] putting circles/buffers arround points on a 2D graph/plot

2009-07-16 Thread Greg Snow
Look at the chull function and its examples. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Ahmed, Sadia > S

Re: [R] Re gression using age and Duration of disease as a continous factors

2009-07-20 Thread Greg Snow
If you need an explanation of what regression means, then you need to take a course or 2 at your local university, or at least hire a statistical consultant. If you understand regression and just need the explanation of how to do it using R, then read section 11 (as well as everything else) of "

Re: [R] Show representation of a data structure

2009-07-21 Thread Greg Snow
You are probably thinking of the "str" function. But also look at the "TkListView" function in the TeachingDemos package for visualizing lists of lists and complex objects. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 80

Re: [R] animated grid graphics

2009-07-21 Thread Greg Snow
Imagemagick and gimp work on windows, linux, and mac as well and have tools for creating animated gifs (and possibly other animation files). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-

Re: [R] Background colour of axis

2009-07-21 Thread Greg Snow
Look at the xpd argument to the par function. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Miguel Lacerda

Re: [R] list of lm() results

2009-07-21 Thread Greg Snow
First make sure that myResults is a list (you probably did this, but just to be sure): > myResults <- list() Then use doubled brackets [[]]: > myResults[[1]] <- lm(...) Etc. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org

Re: [R] Re gression using age and Duration of disease as a continous factors

2009-07-21 Thread Greg Snow
Re gression using age and Duration of disease as a > continous factors > > > I have read that multiple times without understanding anything. > > Greg Snow-2 wrote: > > > > If you need an explanation of what regression means, then you need to > take > > a

Re: [R] How to extract the upper xlim and ylim of my plot?

2009-07-21 Thread Greg Snow
?grconvertX -Original Message- From: "Mark Na" To: "r-help@r-project.org" Sent: 7/21/09 3:05 PM Subject: [R] How to extract the upper xlim and ylim of my plot? Dear R-helpers, I wish to place some text in a plot, at approx 10% of my upper xlim and approx 90% of my upper ylim, i.e. >

Re: [R] simple question about exporting data...

2009-07-23 Thread Greg Snow
Doing the computations in R then the graphs in Excel reminds me of the maxim: Measure with a micrometer Mark with chalk Cut with an ax Before continuing you should really read: http://www.burns-stat.com/pages/Tutor/spreadsheet_addiction.html and look at the final graphic in: http://www.cs.uiowa

Re: [R] help with randomisation test...

2009-07-23 Thread Greg Snow
I am not sure that I fully understand what all you want to do (and I don't understand why you need the correlation and if a correlation based on 3 pairs is even meaningful), but here is a first stab at what you are trying to do: tmp <- "Species Control_CR Damage_DR A 10 2 A 9 3 A 7 4 A 9 2 A 8 3

Re: [R] Random # generator accuracy

2009-07-23 Thread Greg Snow
Try adding replace=TRUE to your call to sample, then you will get numbers closer to what you are expecting. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailt

Re: [R] Random # generator accuracy

2009-07-23 Thread Greg Snow
greg.s...@imail.org 801.408.8111 > -Original Message- > From: Jim Bouldin [mailto:jrboul...@ucdavis.edu] > Sent: Thursday, July 23, 2009 12:49 PM > To: Greg Snow; r-help@r-project.org > Subject: RE: [R] Random # generator accuracy > > > Thanks Greg, that most defi

Re: [R] Constructing lists (yet, again)

2009-07-23 Thread Greg Snow
There are a couple of options: The help page for lapply also includes the help for sapply and sapply has a USE.NAMES argument that may do what you want (specify simplify=FALSE to force the same behavior as lapply). You can post specify the names like: > names(mylist) <- vector.of.names Do eit

Re: [R] Help

2009-07-23 Thread Greg Snow
Try: > cbind( bm, res=apply(bm[,d],1 , sum) ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Alberto Lora M

Re: [R] alternative to rbind within a loop

2009-07-23 Thread Greg Snow
Try something like (untested): > mylist <- lapply(all.files, function(i) read.csv(i) ) > mydf <- do.call('rbind', mylist) If all the csv files are conformable that rbind works on them (if the loop method works then that should be the case) then this will read in each file, store the data frames

Re: [R] rows missing after dataset loaded to R

2009-07-23 Thread Greg Snow
Some programs quote everything to be "safe", others only quote when needed. The only case that I know of that read.table and friends require quotes for is when a separator is inside of a string, for example if you are using spaces as the separator and have some names with spaces in them (e.g. "

Re: [R] Creating a loop to read 3D dataset

2009-07-23 Thread Greg Snow
Something like this (untested) may work for you: > for (i in 1:132) { + a <- clim[ , , i] + nm <- sprint('clim%03d.txt',i) + write.table(a,nm) + } Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Origi

Re: [R] computing the radius of an arc

2009-07-24 Thread Greg Snow
There is a function "rsaga.local.morphometry" in the RSAGA package that says it computes curvature (among other things). It looks like that function was designed for a different type of data than yours is, but it may work, or if not, then you may be able to adapt some of the code to work with y

Re: [R] Stting non-overlaping text positions

2009-07-24 Thread Greg Snow
A general solution is not simple, some options include: The thigmophobe.labels function in the plotrix package will place labels on the side of a point furthest from the closest point (works well in some cases, but does not guarantee non-overlap). The dynIdentify and TkIdentify functions in the

Re: [R] spline regression

2009-07-25 Thread Greg Snow
Natural splines (nsin the splines package rcs in the Hmisc or Design package) are linear outside of the range of the knots. You could use those and just specify the knots to be within the portion that you want to allow to be non-linear. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statis

Re: [R] numbers on barplot

2009-07-27 Thread Greg Snow
Unless you are intentionally trying to distort your data and make the graph harder to read (you don't want to do that), it is better to put the numbers in the margin rather than at the top of the bars. Try the following line after the barplot: > mtext( dat$NumberOfPeople, side=1, line=1.5, at=

Re: [R] pairs plot

2009-07-27 Thread Greg Snow
Look at the pairs2 function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Jos

Re: [R] skip plot/blank plot on purpose (multi-plot question)

2009-07-27 Thread Greg Snow
Also look at the frame and plot.new functions. -Original Message- From: "Mark Knecht" To: "Bert Gunter" Cc: "r-help" Sent: 7/27/09 1:56 PM Subject: Re: [R] skip plot/blank plot on purpose (multi-plot question) On Mon, Jul 27, 2009 at 12:21 PM, Bert Gunter wrote: > Well, all of this ca

Re: [R] skip plot/blank plot on purpose (multi-plot question)

2009-07-28 Thread Greg Snow
nal Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Greg Snow > Sent: Monday, July 27, 2009 5:42 PM > To: Mark Knecht; Bert Gunter > Cc: r-help > Subject: Re: [R] skip plot/blank plot on purpose (multi-plot question) >

Re: [R] vary the parameters for a function

2009-07-28 Thread Greg Snow
If you want to have a gui that allows you to change parameter values using buttons/sliders/etc. and see what the effects are, then look at the tkexamp function in the TeachingDemos package (see the examples on the help page). If you have a predetermined set of values for the parameter of interes

Re: [R] Moving axis-labels

2009-07-28 Thread Greg Snow
You can use par(mgp=c(...)) to change where the axis labels are placed by default, but this affects both the x and y axis. Another alternative is to not plot the x axis label (xlab=''), then use the title or mtext function you can manually place the axis label where you want it. Also look at t

Re: [R] Make my plots bigger and reduce white space around panels?

2009-07-29 Thread Greg Snow
It still was not attached, but you can reduce the white space by reducing the margins using par(mar=c(...)). If you do par(mar=c(0,0,0,0)), then there will be no space between the plots, using values larger than 0 will give space. But beware, you need to either suppress the plotting of axis la

Re: [R] Add a line in a Pairs2 and mark the axis length

2009-07-29 Thread Greg Snow
From: Jose Narillos de Santos [mailto:narillosdesan...@gmail.com] Sent: Wednesday, July 29, 2009 5:10 AM To: petr.pi...@precheza.cz; Greg Snow; r-help@r-project.org Subject: Add a line in a Pairs2 and mark the axis length Hi, I have finally installed TeachingDemos trough zip file and installed on lbrary.

Re: [R] Adding picture to graph?

2009-07-29 Thread Greg Snow
In addition to the other responses, you may want to look at the subplot function in the TeachingDemos package for a way to place the image at a location within the plot (the other answers so far use the image as a full background), see the last example on the help page for a way to use the R log

Re: [R] Drawing lines in margins

2009-07-29 Thread Greg Snow
In addition to Benjamin's response (which is the best way that I know of), you may also want to look at the grconvertX and grconvertY functions for ways to find the coordinates in the margins to plot at. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@

Re: [R] visualizing columns

2009-07-29 Thread Greg Snow
Try the View function (note capitol V), does that do what you want? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Beh

Re: [R] Standard error of Median in MASS library

2009-07-29 Thread Greg Snow
Well the MASS package is support for a book, the details for most of functions in the package are detailed in the book, so if you really want to know, either look at the code, or read the book. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org

Re: [R] Scale set of 0 values returns NAN??

2009-08-04 Thread Greg Snow
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Noah Silverman > Sent: Monday, August 03, 2009 12:26 AM > To: r help > Subject: [R] Scale set of 0 values returns NAN?? [snip] > Using R is forcing me > to take a much deeper l

Re: [R] How to label and unlabel points on scatterplot with mouse pointer

2009-08-12 Thread Greg Snow
Here is one approach that works on Windows (but not other platforms): HWidentify <- function(x,y,label=seq_along(x), xlab=deparse(substitute(x)), ylab=deparse(substitute(y)), ...) { plot(x,y,xlab=xlab, ylab=ylab,...) dx <- grconvertX(x,to='ndc')

Re: [R] Obtaining the value of x at a given value of y in a smooth.spline object

2009-08-12 Thread Greg Snow
Part of the problem is that there could in theory be multiple x values that result in the same y value. One approach if you are happy with something interactive rather than programatical is to use the TkSpline function in the TeachingDemos package to fit the spline function and drag the x-value

Re: [R] Games in R

2009-08-12 Thread Greg Snow
Well there is the sudoku package on CRAN, but sorry it does not play tic-tac-toe or simulate flight. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-hel

Re: [R] Plotting Hints - how to add minor tics on axes

2009-08-12 Thread Greg Snow
You can use the axis function to add tick marks and labels at specified positions (including whatever origin you want to use). If you add shorter tick marks without labels, then they are minor ticks (usually you will suppress the default axes using axes=FALSE or xaxt/yaxt='n', then use the axis

Re: [R] Obtaining the value of x at a given value of y in a smooth.spline object

2009-08-12 Thread Greg Snow
A few functions that may help are splinefun or approxfun along with uniroot. From: Kavitha Venkatesan [kavitha.venkate...@gmail.com] Sent: Wednesday, August 12, 2009 3:43 PM To: Greg Snow Cc: r-help@r-project.org Subject: Re: [R] Obtaining the value of x

Re: [R] Output to screen and file at the same time

2009-08-13 Thread Greg Snow
You may also want to look at ?TeachingDemos::txtStart as an alternative to sink, one advantage is that the commands as well as the output can be included. With a little more work you can also include graphical output into a transcript file. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. St

Re: [R] Coding problem: How can I extract substring of function callwithin the function

2009-08-14 Thread Greg Snow
Kind of to second Steve's concerns, I would suggest that you change the names of your functions slightly (put xx. in front of them or some other prefix). I remember a friend telling of a unix administrator that aliased the rm command to actually run rm -i (rm deletes files, the -i makes it ask y

Re: [R] Solutions of equation systems

2009-08-14 Thread Greg Snow
?solve -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Moreno Mancosu > Sent: Friday, August 14, 2009 1:23 AM

Re: [R] how to draw pentagon?

2009-08-18 Thread Greg Snow
Look at the my.symbols and ms.polygon functions in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.or

Re: [R] Is there a construct for conditional comment?

2009-08-19 Thread Greg Snow
I believe that #if lines for C++ programs is handled by the preprocessor, not the compiler. So if you want the same functionality for R programs, it would make sense to just preprocess the R file. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.

Re: [R] visualizzazione colonne

2009-08-19 Thread Greg Snow
Add ?View (note the capitol V) to the list. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Ottorino-Luca Pan

Re: [R] Confidence interval on parameters from optim function

2009-08-19 Thread Greg Snow
If you f function is a likelihood (or better a log likelihood), then you can do profiling. Take the parameter of interest and change it a small amount from the optimal value, rerun optim with this value fixed and let it optimize over everything else. Repeat this for several values and see how

Re: [R] Is there a construct for conditional comment?

2009-08-20 Thread Greg Snow
54 AM > To: r-help@r-project.org > Subject: Re: [R] Is there a construct for conditional comment? > > > Why not > > if ( 0 ) { > commented with zero > } else { > commented with one > } > > > Greg Snow-2 wrote: > > > > I believe that #if lines for C

Re: [R] simple randomization question: How to perform "sample" in chunks

2009-08-20 Thread Greg Snow
Here is a one liner: (yy <- do.call( rbind, sample( split(xx, xx$a) ) )) Basically reading from inside out, it splits the data frame by a (keeping the structure of b intact within each data frame) and returns it as a list, then that list is randomized, then put back together into a single data

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Greg Snow
If you are using a pre created script file, then you may want to consider going one more step and creating a sweave file. Then you can process this file and the results will include the commands (unless you suppress them) as well as the output, nicely formatted. It can also include graphics an

Re: [R] function of probability for normal distribution

2009-08-20 Thread Greg Snow
It looks like you are reinventing wheels here (not necessarily a bad thing). If you want the probabilities associated with the normal distribution, then look at the help for dnorm and pnorm functions. If you are recreating this as a learning experience/homework, then you should be up front abou

Re: [R] mann whitney u

2009-08-27 Thread Greg Snow
How current is the literature? Is the more recent literature using Mann-Whitney because of inertia rather than best practice? The Mann-Whitney/Wicoxon test is a special case of a permutation test that has a shortcut computation. Fast computers were not available when these tests were develope

Re: [R] Sequence generation

2009-08-29 Thread Greg Snow
Or just use the 'each' argument to seq. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Barry Rowlingson > Se

Re: [R] Offtopic, HT vs. HH in coin flips

2009-08-31 Thread Greg Snow
Well, If the first flip is H, then the HT pattern occurs with the first flip in the second run (after however long the 1st run of heads is). If the first flip is T, then the second run will be H's and the HT pattern will be the first flip of the 3rd run. So the HT pattern will occur after 1 o

Re: [R] permutation and reshuffling

2009-09-01 Thread Greg Snow
Look at ?sample for how to shuffle/permute a single vector (or rows of a data frame/matrix) and ?replicate for a way to do it a bunch of times and return the results in a nice form. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imai

Re: [R] Normalized Y-axis for Histogram Density Plot

2009-09-02 Thread Greg Snow
Your data ranges from 0.67 to 1.21, just to simplify things let's assume the that the histogram will go from the pretty numbers of 0.65 to 1.25 for a total width of 0.6. Now consider the simplest histogram consisting of 1 single bar going from 0.65 to 1.25 (very uninteresting histogram, but goo

Re: [R] How to do rotation for polygon?

2009-09-03 Thread Greg Snow
The my.symbols and ms.polygon functions in the TeachingDemos package may help. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.

Re: [R] Zoomable graphs with multiple plots

2009-09-03 Thread Greg Snow
Look at the zoomplot function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of T

Re: [R] How to do rotation for polygon?

2009-09-11 Thread Greg Snow
2*pi/5, length.out=5), add=FALSE, col=2:6 ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: Hemavathi Ramulu [mailto:hema.ram...@gmail.com] Sent: Thursday, September 10, 2009 2:44 AM To: Greg Snow Cc: r-help@r-proje

Re: [R] Is there an equivalent of "echo"

2009-09-14 Thread Greg Snow
The cat() function has already been pointed out to you (and that may be enough), but for a little more elaborate alternative, see the txtStart and txtComment functions in the TeachingDemos package for a glorified wrapper to sink/cat/etc. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

Re: [R] What are the return values of aov?

2009-09-14 Thread Greg Snow
I think Penkyu is not asking for the statistical definitions, but rather some help for what the different parts of the object are. Elements like coefficients and residuals seem fairly obvious (but could still be somewhat ambiguous, are the residuals raw/standardized/studentized/etc.). Objects

Re: [R] symbols(x,y, circles=sqrt(N)) with lattice xyplot

2009-09-14 Thread Greg Snow
The symbols function is base graphics which does not play nicely with lattice graphics (without extra work). Here is one approximation that works with lattice: x <- runif(10) y <- rnorm(10) z <- runif(10, 1,5) library(lattice) library(TeachingDemos) # for panel.my.symbols and friends xyplot( y

Re: [R] syntax of formula

2009-09-14 Thread Greg Snow
Section 11.1 and 11.4 of "An Introduction to R" gives a pretty thorough start for aov models (does not get into mixed/survival and others). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r

Re: [R] T-test to check equality, unable to interpret the results.

2009-09-18 Thread Greg Snow
It appears that you have a fundamental misunderstanding of what p-values do and do not say (though this misunderstanding is commom). The following article addresses this issue and could help with a better understanding: Murdock, D, Tsai, Y, and Adcock, J (2008) _P-Values are Random Va

Re: [R] T-test to check equality, unable to interpret the results.

2009-09-18 Thread Greg Snow
Rolf, I no longer claim to be young, the naïve part is still up for debate, but I find that restricting the null to only include = to be more confusing than to have it include the inequality. To have the alternative be > and the null be = implies that we are working on the assumption

Re: [R] Writing Reports from R in Microsoft Office Open XML format (follow-up)

2009-09-18 Thread Greg Snow
The people who brought us rexcel are working on sword which is a sweave for ms word, the current version is at: http://rcom.univie.ac.at/download.html hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -O

Re: [R] Writing Reports from R in Microsoft Office Open XML format (follow-up)

2009-09-18 Thread Greg Snow
e Lang [mailto:dun...@wald.ucdavis.edu] > Sent: Friday, September 18, 2009 11:00 AM > To: Greg Snow > Cc: Tobias Sing; r help > Subject: Re: [R] Writing Reports from R in Microsoft Office Open XML > format (follow-up) > > > I believe that their approach is based on DCOM a

Re: [R] Handling missing data

2009-09-21 Thread Greg Snow
Help us to help you, show us the code that you tried, what you expected, and what you saw. Does "using NA condition" mean: > x == NA Which does not work Or > is.na(x) Which should. -Original Message- From: "premmad" To: "r-help@r-project.org" Sent: 9/21/09 12:38 AM Subject: [R]

Re: [R] No parametric methods

2009-09-23 Thread Greg Snow
For power studies you need to think about what the data will look like under the alternative hypothesis. Is the data shifted over a certain amount? (the most common assumption), or scaled? Or both? Or a completely different shape? Etc. My preferred method for power studies in this case is to u

Re: [R] dotchart to barplots

2009-09-23 Thread Greg Snow
The current recommendation is to not put designs/hash lines/pictures/etc. into the bars, but to use a single solid color (gray in your case). Back when a quality graph meant using a pen plotter, hash lines made sense as a way to distinguish between bars, but quality graphics no longer depend on

Re: [R] Statistical analysis

2009-09-24 Thread Greg Snow
Since todays ground water may be influenced by yesterdays rainfall, you may want to look at the dynlm package and possibly lag.plot and the zoo package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message

Re: [R] RODBC problem

2009-09-24 Thread Greg Snow
Try it without the '$' in the table name, that has worked for me in the past. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.o

Re: [R] multinormial runs tests?

2009-09-24 Thread Greg Snow
You can do this by simulation: Generate data from a multinomial of the same length as your data (the sample function can help) using either theoretical or observed probabilities. Measure the length of the longest run, or the number of runs (the rle function can help). Repeat this a bunch of ti

Re: [R] Non-parametric test for location with two unpaired sets of data measured on ordinal scale.

2009-09-24 Thread Greg Snow
What do you mean by location? I can think of examples where 2 distributions have the same median but different means, or the same means but different medians. Are you willing to assume that the distributions are exactly the same under the null hypothesis? (not just the same 'center/location')

Re: [R] Non-parametric test for location with two unpaired setsof data measured on ordinal scale.

2009-09-25 Thread Greg Snow
Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: John Sorkin [mailto:jsor...@grecc.umaryland.edu] > Sent: Thursday, September 24, 2009 2:52 PM > To: Greg Snow; r-help@r-project.org >

Re: [R] Non-parametric test for location with two unpaired sets of data measured on ordinal scale.

2009-09-25 Thread Greg Snow
, September 25, 2009 12:17 PM > To: Greg Snow > Cc: John Sorkin; r-help@r-project.org > Subject: Re: [R] Non-parametric test for location with two unpaired > sets of data measured on ordinal scale. > > Greg and John, > > Just to throw it out there, the data sets here are

Re: [R] Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number

2009-06-09 Thread Greg Snow
Here is one way using a single pattern (so can be used in a substitution), it uses Perl's positive look ahead patters: > test <- > c("SHRT","5HRT","M1TCH","M1TCH5","LONG3RS","NONUMBER","TOOLNGG","ooops.3") > > sub( '(?=[a-zA-Z]{0,8}[0-9])[a-zA-Z0-9]{5,9}', 'xxx', test, perl=TRUE) [1] "SHRT"

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Greg Snow
You can sometimes fake variable width look behinds with Perl regexs using '\K': > gregexpr('\\b[0-9]+\\K[.]', 'a. 1. a1. 11.', perl=TRUE) [[1]] [1] 5 13 attr(,"match.length") [1] 1 1 -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.81

Re: [R] Non-linear regression/Quantile regression

2009-06-09 Thread Greg Snow
poly by default uses orthogonal polynomials which work better mathematically but are harder to interpret. See ?poly -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.

Re: [R] using regular expressions to retrieve a digit-digit-dot structure from a string

2009-06-09 Thread Greg Snow
On Behalf Of Gabor Grothendieck > Sent: Tuesday, June 09, 2009 11:27 AM > To: Greg Snow > Cc: Wacek Kusnierczyk; r-help@r-project.org; Mark Heckmann > Subject: Re: [R] using regular expressions to retrieve a digit-digit- > dot structure from a string > > Wacek already mentioned

Re: [R] triangular plot

2009-06-13 Thread Greg Snow
Also triplot in TeachingDemos -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of David Carlson > Sent: Friday, J

Re: [R] Referencing data frames

2009-06-15 Thread Greg Snow
Generally when someone asks a question like this, they are trying to program in a different language using R rather than taking advantage of the power of R itself. If you give us more information on what you are trying to accomplish, then we may be able to give better advice on how to accomplis

Re: [R] Referencing data frames

2009-06-15 Thread Greg Snow
m.minoo...@meissner.com] Sent: Monday, June 15, 2009 10:39 AM To: Greg Snow; r-help@r-project.org Subject: Re: Referencing data frames You are, indeed, correct. I'm still used to the IGOR Pro programming language (for which I even wrote an introductory manual, http://payam.minoofar.com/igor

<    3   4   5   6   7   8   9   >