Re: [R] Kolmogorov-Smirnov test

2011-09-26 Thread Greg Snow
. - Thanks! I expected this also. nbsp; Thank you. nbsp; -Rommel nbsp; nbsp; nbsp; nbsp; - Ursprüngliche Nachricht - Von: Greg Snow-2 [via R] lt;ml- node+s789695n3838250...@n4.nabble.comgt; Datum: Samstag, 24. September 2011, 12:52 am Betreff: Re: Kolmogorov-Smirnov test

Re: [R] Kolmogorov-Smirnov test

2011-09-26 Thread Greg Snow
801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Greg Snow Sent: Monday, September 26, 2011 11:45 AM To: rommel; r-help@r-project.org Subject: Re: [R] Kolmogorov-Smirnov test There are criteria to tell

Re: [R] Kolmogorov-Smirnov test

2011-09-23 Thread Greg Snow
Are you doing the 2 sample KS test? Comparing if 2 samples come from the same distribution? With 3,000 points you will still likely have power to find meaningless differences, what exactly are you trying to accomplish by doing the comparison? I am really only familiar with the KS test done in

Re: [R] help in interpreting paired t-test

2011-09-21 Thread Greg Snow
It looks like Bland-Altman procedures would be appropriate for this project (http://en.wikipedia.org/wiki/Bland-Altman_plot). -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Pedro Mardones Sent: Tuesday, September 20, 2011 11:47

Re: [R] Planned comparison ANOVA

2011-09-19 Thread Greg Snow
Here is one example of doing it, first create a matrix with all your contrasts (I added some to make it full), then invert it to get the dummy variable encodings, use the 'contrast' function (or 'C') to set the contrasts, then use 'aov' or 'lm' and those contrasts will be used: my.contrasts -

Re: [R] writing data from several matrices in R into one excel-file with several sheets

2011-09-16 Thread Greg Snow
Look at the XLConnect 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-bounces@r- project.org] On Behalf Of Marion Wenty Sent: Friday,

Re: [R] x %% y as an alternative to which( x y)

2011-09-15 Thread Greg Snow
One additional thing to note is that %% will have different precedence than (something that was pointed out to me based on %% that is in the TeachingDemos package). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111

Re: [R] Nonlinear regression question

2011-09-15 Thread Greg Snow
What null hypothesis are you trying to test? There is a standard null for linear models that makes sense in a large number of cases, but what the null is for non-linear regression is not obvious (and the coefficient = 0 may not even be possibly, let alone interesting). If you can state what

Re: [R] how to identify the value in a scatterplot?

2011-09-15 Thread Greg Snow
?identify -- 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-bounces@r- project.org] On Behalf Of bby2...@columbia.edu Sent: Thursday, September 15,

Re: [R] import csv file into R, strange problem

2011-09-13 Thread Greg Snow
It would appear that your file is not a csv file, but we cannot tell for sure without seeing an example of the data that you are reading in, can you cut and paste the first few lines of the file? Or post a link to a copy of the file. If the data is not able to be shared, then create a new

Re: [R] Multiple t.test

2011-09-12 Thread Greg Snow
Here is another approach. A linear regression with a single binomial predictor will give the same results as a pooled t-test (if you insist on non-pooled then use sapply as previously suggested). The lm function will do multiple regressions if given a matrix as the y-variable, so you can do a

Re: [R] Centering lines on barplot centers.

2011-09-12 Thread Greg Snow
Setting par(usr=something) does not survive the creating of a new high level plot. Using par(new=TRUE) is to be avoided if at all possible (it just leads to problems like yours), it would be better for you to use matlines instead of matplot which adds lines to the current plot. If you want to

Re: [R] how to get character from keyboard when run a file

2011-09-10 Thread Greg Snow
Are you running a script using 'source' or in batch mode? And do you want the script to get input from a user instead of from the script? If that is the case then you need to work a little harder because R assumes that if you are running in a non-interactive mode (source and batch mode) that

Re: [R] Looping through multiple datasets already in memory

2011-09-09 Thread Greg Snow
The best approach is to put all those datasets into a list, then you can loop through the elements of the list, or use lapply or sapply on the list. If you insist on keeping them outside of a list, or need a loop to put them into the list, then look at the 'get' function. -Original

Re: [R] Density function: Area under density plot is not equal to 1. Why?

2011-09-08 Thread Greg Snow
For bounded density estimation look at the logspline package instead of the regular density 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

Re: [R] get arguments passed to function inside a function

2011-09-01 Thread Greg Snow
The sys.call or match.call functions may be what you are looking for: tmpfun - function(x,y,z,...) { + as.list( sys.call() ) + } tmpfun( x=5, w=3, 1:10 ) [[1]] tmpfun $x [1] 5 $w [1] 3 [[4]] 1:10 tmpfun2 - function(x,y,z,...) { + as.list( match.call() ) + } tmpfun2( x=5, w=3, 1:10 )

Re: [R] Simulating distribution of max of two die

2011-08-31 Thread Greg Snow
For this example you can work out every possibility, you can use this in place (or in addition to) the simulations. Here is a quick example with a couple other ways to look at what is happening: all.rolls - expand.grid(1:6,1:6) max.roll - apply(all.rolls, 1, max)

Re: [R] separate mfrow region with line

2011-08-29 Thread Greg Snow
The grconvertX and grconvertY functions may be helpful in finding the endpoints to use. -- 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-bounces@r-

Re: [R] control line break behavior of R output

2011-08-29 Thread Greg Snow
If your main goal is to look at a data frame and you are ok with scrolling, then look at the View function (note capitalization) as an alternative to just printing the data frame. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111

Re: [R] Easier ways to create .Rd files?

2011-08-25 Thread Greg Snow
For the initial .Rd file look at the 'prompt' function, it will create a basic .Rd file based on the current function definition with all the structure in place, then you go in and edit it to have more meaningful information. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

Re: [R] interpreting interactions in a model

2011-08-23 Thread Greg Snow
The Predict.Plot function in the TeachingDemos package can help you visualize interactions. It will work best if Month is treated as a continuous variable. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original

Re: [R] Automating an R function call

2011-08-12 Thread Greg Snow
Do you want to be doing other things with the R terminal in the meantime? Are you OK with the terminal being locked up between runs and just want to see the output updated? Is it OK to have a new instance of R run the function? If the last one is doable then you can have your OS scheduled to

Re: [R] Sample size AUC for ROC curves

2011-08-09 Thread Greg Snow
If you know how to generate random data that represents your null hypothesis (chance, auc=0.5) and how to do your analysis, then you can do this by simulation, simulate a dataset at a given sample size, analyze it, repeat a bunch of times and see if that sample size is about the right size. If

Re: [R] a question on list manipulation

2011-08-05 Thread Greg Snow
Here is one approach, whether it is better than the basic loop or not is up to you: x - list(A=c(d, e, f), B=c(d, e), C=c(d)) tmp - unlist(x) tmp2 - sub( '[0-9]+$', '', names(tmp) ) x.new - split( tmp2, tmp ) x.new $d [1] A B C $e [1] A B $f [1] A Of course this version will have

Re: [R] Displaying a summary in graphics

2011-08-05 Thread Greg Snow
Use the capture.output function with printing the summary of the anova, then pass that to your 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

Re: [R] Text annotation of a graph

2011-08-05 Thread Greg Snow
Look at the spread.labs function in the TeachingDemos package, it may do what you want (see the 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

Re: [R] Coefficient names when using lm() with contrasts

2011-08-03 Thread Greg Snow
If you add column names to your contrast matrix (treat3) then those names will be used in the coefficient names. -- 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

Re: [R] Problems with ks.test()

2011-07-30 Thread Greg Snow
What makes you think that the p-value of 1 is more accurate than the p-value of 0? The K-S test will show significance for very small differences in distributions when the sample size is big enough. Also, it is not clear that you are using it correctly. Generally you would just give the raw

Re: [R] How to interpret Kolmogorov-Smirnov stats

2011-07-30 Thread Greg Snow
Which package is gofstat in? can you show us your data, or some details about your data? Note that the KS test (and all goodness of fit tests) are rule out tests, they can show that the data is unlikely to come from a distribution, but can never prove that it does come from a distribution.

Re: [R] Looping through data sets to change column from character to numeric

2011-07-30 Thread Greg Snow
Others have shown how to do this, but a better approach may be to load your .Rdata file into a new environment rather than the global environment, then you can work with the environment (and all the objects in it) using lapply, or loops with [[]] instead of fighting with get and assign.

Re: [R] help with rpart

2011-07-29 Thread Greg Snow
Well there is the esp package, though it is still very pre-alpha. Let's see what it has to suggest for this question: source('g:/R/esp/esp.R') esp() [1] tabulation overabundant positron carfare contaminant sprawl station swat aversion Wow, that almost looks like it should make some sense,

Re: [R] smooth scatterplot and geo map

2011-07-28 Thread Greg Snow
The usual smoothed scatterplot assumes that the x variable (longitude) is fixed and that the y-variable (latitude) is observed with error, and that the mapping is 1 to 1 or 1 to many in that for each value of x you can have at most one y value. These assumptions don't seem to make much sense

Re: [R] Data frame to list

2011-07-28 Thread Greg Snow
?split -- 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-bounces@r- project.org] On Behalf Of Jonathan Greenberg Sent: Thursday, July 28, 2011 2:14

Re: [R] tcltk

2011-07-22 Thread Greg Snow
The tkexamp function in the TeachingDemos package can help with creating tcltk dialog boxes. There are also several other functions in that package that use tcltk dialogs that you could use as examples to build your own if tkexamp is not enough for you. -- Gregory (Greg) L. Snow Ph.D.

Re: [R] special question on regression

2011-07-18 Thread Greg Snow
I remember seeing an example using the EM algorithm where one of the variables was age of child and they assumed that an age like 16 months was accurate to the month, but ages like 18 months may have been off by as much as 2 months and ages like 3 years could be off by 6 months (or more), so

Re: [R] Number in interval

2011-07-18 Thread Greg Snow
A small modification of this would be: library(TeachingDemos) -3 %=% z %=% 3 Whether that is prettier or uglier than Jim's answer is in the eye of the beholder (for longer variable names this version could save a few key strokes). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center

Re: [R] ?Accuracy of prop.test

2011-07-18 Thread Greg Snow
Others have explained why R gives a different answer based on a different approximation, but if you want to get the same answer as the book/minitab/... for your own understanding (or so the grader doesn't get confused by superior answers, or other reasons) here is one way to do it: x - c(

Re: [R] customize output in Excel and creating reports in word.

2011-07-18 Thread Greg Snow
There are several options depending on what exactly you want to do. If you use code like: write.table(x, 'clipboard', sep='\t') In R, then go to excel and choose a cell and paste to it, the matrix or data frame 'x' will be pasted into excel at that point (topleft corner of data goes in

Re: [R] Number in interval

2011-07-18 Thread Greg Snow
, 2011 3:10 PM To: Greg Snow; jim holtman; Manuel K. Cc: r-help@r-project.org Subject: RE: [R] Number in interval Note that the precendence of %=% is not the same as that of =, so you can be surprised by its behavior in slightly more complex expressions: z - seq(1.2, len=5, by=.7

Re: [R] Add coordinates at specific points...

2011-07-14 Thread Greg Snow
To add to what David and Duncan wrote: If you want to plot something at a point where the x coordinate is in user coordinates, but the y-coordinate is something like the middle of the plot, or 1/5th of the way from the top then you can use the grconvertY function along with the text function.

Re: [R] Save generic plot to file (before rendering to device)

2011-07-11 Thread Greg Snow
Note the warning on the help page for recordPlot. If your colleague is using a different version of R than you there could be problems. Another approach (or the start to one that you could build on) is the plot2script function in the TeachingDemos package (which uses recordPlot internally).

Re: [R] Simple conditional plot

2011-07-08 Thread Greg Snow
Try plot(Well~Raw, subset= Plate==101) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of rstudent Sent: Friday, July 08, 2011 8:56 AM To: r-help@r-project.org Subject: [R] Simple conditional plot I just started using R last week.

Re: [R] Taking inputs from the user

2011-07-08 Thread Greg Snow
Are your users willing to install an Excel plug-in? If so, look at the RExcel project, it does what you describe and the common user thinks they are just using Excel with a plug-in without realizing that they have installed and are using a useful tool in the background. -Original

Re: [R] Using t tests

2011-07-08 Thread Greg Snow
How are you measuring length of stay? A chi-square test suggests that you have it categorized, a t-test assumes it is continuous (and relatively symmetric with the amount depending on sample size). Do you have any censoring? (patients dying or transferring before discharge) if so you should

Re: [R] accessing names of lists in a list

2011-07-06 Thread Greg Snow
In general, if the data frames are all related then it is best to keep them together in a list like you have. But if you want to change the names of the component data frames then you can use a loop, or sometimes better use the lapply function. Here is a basic example: tmp - list(

Re: [R] How to translate string to variable inside a command in an easy way in R

2011-07-05 Thread Greg Snow
You are suffering from the fact that the longest distance between 2 points is a shortcut. The df$column notation is a shortcut for df[[column]] that has some nice properties, but the shortcut gets in the way when you want to do something more structured. Try qq1[[z]]==y and avoid all that

Re: [R] source, echo...and clicking the mouse

2011-07-01 Thread Greg Snow
:31 PM To: Greg Snow Cc: Steven Wolf; 'David Winsemius'; r-help@r-project.org Subject: Re: [R] source, echo...and clicking the mouse On 30/06/2011 5:33 PM, Greg Snow wrote: On some operating systems (which we don't know yours, see the posting guide) the output is buffered and including

Re: [R] very large pair() plot

2011-06-30 Thread Greg Snow
In addition to Uwe's answer, you might also want to consider the pairs2 function in the TeachingDemos package. It lets you plot sections of the overall scatterplot matrix rather than the whole thing, so you could spread the entire scatterplot matrix over multiple pages. -- Gregory (Greg) L.

Re: [R] source, echo...and clicking the mouse

2011-06-30 Thread Greg Snow
On some operating systems (which we don't know yours, see the posting guide) the output is buffered and including a call to flush.console() will flush all the output from the buffer to the console. Put the function call throughout the script and when it is run it will stop buffering for a bit.

Re: [R] Creating a Polar Plot with expanding points as radius increases

2011-06-27 Thread Greg Snow
I would look at the ggplot2 package, I have seen examples using ggplot2 that look similar to what you describe. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Patrick Jemison Sent: Monday, June 27, 2011 4:36 PM To:

Re: [R] text overlap in plot

2011-06-24 Thread Greg Snow
Look at the spread.labs function in the TeachingDemos package or the spread.labels function in the plotrix package. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David martin Sent: Friday, June 24, 2011 8:07 AM To:

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Greg Snow
Here is one approach (different from capture.output) that I believe accomplishes what you are trying to do: frtop - function(){ out - numeric(0) topenv - environment() fr - function(x) { ## Rosenbrock Banana function x1 - x[1] x2 - x[2]

Re: [R] Finding the levels in a data frame column

2011-06-23 Thread Greg Snow
Try levels(df$city) or unique(df$city) depending on if it is a factor (default) or character string. -- 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

Re: [R] Unreasonable syntax error

2011-06-22 Thread Greg Snow
I second the fortune nomination, probably the 1st paragraph is sufficient for a fortune. -- 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-bounces@r-

Re: [R] prediction intervals

2011-06-17 Thread Greg Snow
recommend is look through the task view. Maybe someone else has a better refrence. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: Dave Evens [mailto:daveeve...@yahoo.co.uk] Sent: Friday, June 17, 2011 1:48 AM To: Greg Snow

Re: [R] Polygon question

2011-06-17 Thread Greg Snow
Does this do what you want? x - abs(rnorm(100)) tt - 1:100 m - mean(x) par(mfrow=c(2,1)) yy - c(0,3)# y-limit plot(tt,x,type=l,ylim=yy) abline(h=m) clip(0,100,0,m) polygon( c(1,tt,100), c(m,x,m), col='red' ) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [R] combining strings

2011-06-17 Thread Greg Snow
What do you want to happen when both are NA? what do you want to happen if both have values? -- 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

Re: [R] prediction intervals

2011-06-16 Thread Greg Snow
I don't think that this approach is appropriate here. Each iteration after the 1st the lm/predict combination will assume that the new data is exact when in fact it is an estimate with some error involved. To properly do this you need to take into account that variability. There is a time

Re: [R] NonParametric Anova

2011-06-16 Thread Greg Snow
You could do this using permutation tests. If everything is balanced and orthogonal then you can permute the predictors, otherwise you can follow these main steps: 1. Formulate the test of interest as a full and reduced model test and find the F statistic (or other, but I will assume F) for

Re: [R] When models and anova(model) disagree...

2011-06-15 Thread Greg Snow
The individual tests on coefficients in logistic regression are generally based on a Wald test statistic. Unfortunately there is a bit of a paradox possible in this case where the coefficient is highly significant, but due to a flattening of the likelihood the standard error is overestimated

Re: [R] Bayesian Credible Intervals for a Proportion

2011-06-15 Thread Greg Snow
It would help us to help you if you told us which package ncredint is in (it is not in any of the packages that is installed on the computer I am presently using, but could be in multiple others). Does this interval match what you are expecting? library(TeachingDemos) hpd(qbeta, shape1=4,

Re: [R] automatically generate the output name of my for loops

2011-06-14 Thread Greg Snow
This is actually FAQ 7.21. As others have mentioned, the most important part of the Answer is that it is better to use a list instead. What searching did you do before posting? Is there some way that the FAQ could be changed that would have made your searching turn up the FAQ answer? --

Re: [R] use variable value to create new variable name

2011-06-14 Thread Greg Snow
This is actually FAQ 7.21 (though the FAQ does not specify how to create the name in a loop). As others have mentioned, the most important part of the Answer is that it is better to use a list instead. What searching did you do before posting? Is there some way that the FAQ could be changed

Re: [R] remove commas in a number when reading a text file

2011-06-14 Thread Greg Snow
The following link may be of interest. It shows a way to use gsub, but have it automatically applied while reading the data in rather than converting after: http://finzi.psych.upenn.edu/Rhelp10/2010-February/229550.html -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

Re: [R] plotting on an image

2011-06-14 Thread Greg Snow
If you are willing to prepend a step then you could: 1. Create an empty plot using your data and type='n' (or just plot the data, the points will be overwritten), you may want to set the asp argument, or explicitly do the xlim and ylim arguments. 2. Add the graphic using the rasterImage

Re: [R] Off-topic: (Simple?) Random Sampling when n is a random variable

2011-06-14 Thread Greg Snow
This sounds like what is called domains in survey sampling (possibly other names, but that is what I learned it as). The idea is that you take a random sample (or the population) then ask a question to determine which domain the subject is in, then ask the question of interest in the domain of

Re: [R] automatically generate the output name of my for loops

2011-06-14 Thread Greg Snow
In the windows GUI you can click on the Help menu and then click on 'FAQ on R' to see the entire FAQ. Typing help.start() on any OS should open a new browser window with a link to the FAQ. Going to the R homepage (http://www.r-project.org) and clicking on the FAQs link on the left will also

Re: [R] automatically generate the output name of my for loops

2011-06-14 Thread Greg Snow
, Greg Snow-2. here i hav a question, how can i save the value of a list to a vector or a matrix? say, i have a list (data1) and a vector or a matrix (data2). if i made like this, data2 - as.vector(data1) it does not change anything, the data2 is still a list. what i want to do

Re: [R] running R commands asynchronously

2011-06-11 Thread Greg Snow
this that don't have the experience to know better. -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Friday, June 10, 2011 11:36 PM To: Greg Snow Cc: Richard M. Heiberger; r-help Subject: Re: [R] running R commands asynchronously On Fri, 10 Jun 2011, Greg Snow wrote

Re: [R] Test if data uniformly distributed (newbie)

2011-06-10 Thread Greg Snow
Yes, punif is the function to use, however the KS test (and the others) are based on an assumption of independence, and if you know that your data points sum to 1, then they are not independent (and not uniform if there are more than 2). Also note that these tests only rule out distributions

Re: [R] Test if data uniformly distributed (newbie)

2011-06-10 Thread Greg Snow
Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: kairavibha...@googlemail.com [mailto:kairavibha...@googlemail.com] On Behalf Of Kairavi Bhakta Sent: Friday, June 10, 2011 2:16 PM To: Greg Snow; r-help@r-project.org Subject: RE: [R] Test if data

Re: [R] running R commands asynchronously

2011-06-10 Thread Greg Snow
Tk windows run asynchronous to the rest of R, so you could write a small function that lets you type the command into a Tk window and runs it while you continue to work in the main R, then the window could signal you when the function finishes. -Original Message- From:

Re: [R] [Plea to the R Gods] Theoretical and Empirical CDFs

2011-06-02 Thread Greg Snow
Look at the logspline package for one approach to doing this. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of teriri Sent: Thursday, June 02, 2011 12:19 AM To: r-help@r-project.org Subject: [R] [Plea to the R Gods] Theoretical and

Re: [R] Reading Data from mle into excel?

2011-05-31 Thread Greg Snow
The sink function will write to a file what normally shows up on the screen after running some code. So while it is possible to use it to capture the output of the mle command and read the results into excel, I don't see anything useful that you could then do with it in excel. If you can tell

Re: [R] Reading Data from mle into excel?

2011-05-31 Thread Greg Snow
I did not see any code above, but you could write a simple function that does the mle fit (is this mle from the stats4 package?) then extracts the information that you want and puts it into a vector, something like: out - c( coef(fit), sqrt(diag(vcov(fit))), ll=logLik(fit) ) And returns the

Re: [R] Normality test

2011-05-30 Thread Greg Snow
rare value between 999.99 and 1000. -Original Message- From: Bogaso Christofer [mailto:bogaso.christo...@gmail.com] Sent: Sunday, May 29, 2011 12:15 AM To: Greg Snow; R-help@r-project.org Subject: RE: [R] Normality test Hi Greg, please forgive me as I could not understand one part

Re: [R] Normality test

2011-05-28 Thread Greg Snow
To build on Robert's suggestion (which is very good to begin with), you might consider using the vis.test function in the TeachingDemos package with the vt.qqnorm function. This will create the qq plot of your data along with several other qqplots of normal samples of the same size. If you

Re: [R] Markov Chain model coding

2011-05-28 Thread Greg Snow
The msm package may be of use to you. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of phillowe Sent: Saturday, May 28, 2011 10:51 AM To: r-help@r-project.org Subject: [R] Markov Chain model coding Can anyone help with coding for

Re: [R] Observation in a confidence ellipse

2011-05-28 Thread Greg Snow
There are point in polygon functions in some of the spatial packages that would tell you if a point is within a polynomial approximation of the ellipse. But in your case I would take a different approach. Generally confidence ellipses are based on manhalobis distances, so you can just compute

Re: [R] What are the common Standard Statistical methods used for the analysis of a dataset

2011-05-26 Thread Greg Snow
...@imail.org 801.408.8111 -Original Message- From: Stephan Kolassa [mailto:stephan.kola...@gmx.de] Sent: Wednesday, May 25, 2011 3:49 PM To: Greg Snow Cc: r-help@r-project.org Subject: Re: [R] What are the common Standard Statistical methods used for the analysis of a dataset Dear all

Re: [R] What are the common Standard Statistical methods used for the analysis of a dataset

2011-05-25 Thread Greg Snow
Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: Michael Dewey [mailto:i...@aghmed.fsnet.co.uk] Sent: Wednesday, May 25, 2011 1:14 PM To: Greg Snow; Ramnath R; r-help@r-project.org Subject: Re: [R] What are the common Standard Statistical

Re: [R] What are the common Standard Statistical methods used for the analysis of a dataset

2011-05-24 Thread Greg Snow
The only statistical method that I know of that can be applied to any dataset without further definition of the nature of the data or the question being asked is SnowsCorrectlySizedButOtherwiseUselessTestOfAnything which is found in the TeachingDemos package for R. However this test is not

Re: [R] help on permutation/randomization test

2011-05-24 Thread Greg Snow
If the x's that don't enter at the same time can be considered independent of each other, and only clusters that enter at the same time are dependent, then you can still do a permutation test by creating clusters with dependent values within each cluster, but independent between clusters, then

Re: [R] help on permutation/randomization test

2011-05-24 Thread Greg Snow
). The random number generators in R are based on good theory, I doubt that there would be any problems with using the sample function for randomization tests. From: Wenjin Mao [mailto:wenj@gmail.com] Sent: Tuesday, May 24, 2011 6:54 PM To: Greg Snow Cc: Meyners, Michael; r-help@r-project.org

Re: [R] Converting the graphics window to a data matrix

2011-05-20 Thread Greg Snow
The EBImage package from bioconductor will read image files (png and others), the object read has a slot called .Data that is a 3 dimensional array with one dimension being the color (red,green,blue), so you could just grab one of those 3 layers and it would probably be what you want (or some

Re: [R] identical function names from 2 packages

2011-05-20 Thread Greg Snow
From the command line the namespaces may not help much (I am happy to be corrected). But if I am running a function from the command line then I can check the search path to see if there is a conflict and make sure to call the correct one, the bigger problem is when writing another package

Re: [R] Building Custom GUIs for R

2011-05-20 Thread Greg Snow
I think that the Rcmdr package already does a lot of what you want, rather than starting from scratch you should check it out. Rcmdr has the functionality of letting you write your own add-ins, so if it currently does not have the functions that you want you could just create an add-in to add

Re: [R] [r] regression coefficient for different factors

2011-05-20 Thread Greg Snow
Look at the lmList function in the nlme package, it does what I think 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-bounces@r-

Re: [R] Plots: I've deleted axes, now to delete space

2011-05-16 Thread Greg Snow
If your goal is to end up with a pdf file, then I would suggest creating the pdf file directly using the pdf function (you can specify height and width in the function) then run your commands to create the plot and use dev.off() to finish. You often get different results when writing directly

Re: [R] simulation from truncated poisson

2011-05-16 Thread Greg Snow
Which direction is it truncated? (only values less than a allowed or only greater?). One simple approach is rejection sampling, just generate from a regular poisson distribution, then throw away any values in the truncated region. Another approach if the legal values are those from 0 to a,

Re: [R] simulation from truncated poisson

2011-05-16 Thread Greg Snow
] Sent: Monday, May 16, 2011 7:46 PM To: Greg Snow Cc: r-help@r-project.org Subject: Re: [R] simulation from truncated poisson It is truncated from left. On Mon, May 16, 2011 at 6:33 PM, Greg Snow greg.s...@imail.orgmailto:greg.s...@imail.org wrote: Which direction is it truncated? (only values

Re: [R] Plots: I've deleted axes, now to delete space

2011-05-13 Thread Greg Snow
Look at the help for par, specifically the section on 'mar' to set the per plot margins smaller and the section on 'oma' to leave room for the overall title. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original

Re: [R] Plots: I've deleted axes, now to delete space

2011-05-13 Thread Greg Snow
- From: adele_thomp...@cargill.com [mailto:adele_thomp...@cargill.com] Sent: Friday, May 13, 2011 2:21 PM To: Greg Snow; r-help@r-project.org Subject: RE: [R] Plots: I've deleted axes, now to delete space Easy fix. Under ?par, I don't see where I can enter an overall title. Should I add a text

Re: [R] Simple 95% confidence interval for a median

2011-05-12 Thread Greg Snow
Contrary to the commonly held assumption, the Wilcoxin test does not deal with medians in general. There are some specific cases/assumptions where the test/interval would apply to the median, if I remember correctly the assumptions include that the population distribution is symmetric and the

Re: [R] Change font size in Windows

2011-05-12 Thread Greg Snow
One simple way: Run R (the gui version) Click on the Edit menu Click on the GUI Preferences item. Select the font, size, style, colors, etc. that you want. If you click on Save then these become the new default. If you click on Apply, but don't save then they will last that session but not be

Re: [R] Total effect of X on Y under presence of interaction effects

2011-05-11 Thread Greg Snow
Just to add to what David already said, you might want to look at the Predict.Plot and TkPredict functions in the TeachingDemos package for a simple interface for visualizing predicted values in regression models. These plots are much more informative than a single number trying to capture

Re: [R] displaying derived coefficients in lm

2011-05-11 Thread Greg Snow
Look at the dummy.coef 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-bounces@r- project.org] On Behalf Of James Lawrence Sent:

Re: [R] reading a column as a character vector

2011-05-06 Thread Greg Snow
The strsplit function is probably the closest R function to perls split function. For more detailed control the gsubfn package can be useful. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gamliel Beyderman Sent: Thursday, May

Re: [R] split character vector by multiple keywords simultaneously

2011-05-06 Thread Greg Snow
Will all the keywords always be present in the same order? Or are you looking for the keywords, but some may be absent or in different orders? Look into the gsubfn package for some tools that could help. -Original Message- From: r-help-boun...@r-project.org

Re: [R] histograms and for loops

2011-05-06 Thread Greg Snow
1. ?paste ?sprintf 2. ?par (look at col.axis) ?axis 3. ?pdf ?png ?dev.copy -- 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-bounces@r- project.org]

<    2   3   4   5   6   7   8   9   10   11   >