Re: [R] bptest

2010-09-25 Thread Andrew Miles
First load the package lmtest. Then run the bptest. library(lmtest) bptest(modelCH) You don't need to tell the function which variables are explanatory or dependent. Just give it the fitted model object, and it will sort all of that out and return the statistic. Andrew Miles Department

[R] How to store regex expression in a variable

2010-09-25 Thread Yong Wang
dear list I know how to store a regex expression in perl and ruby, no clue on R. I do read R regex manual , archives, and searched on line, still I need somebody help me out on how to store a regular expression in a variable. Thank you very much yong

Re: [R] Multiple graph in one graph window

2010-09-25 Thread Andrew Miles
Another option is to use the par() command before executing a plot command, like so: par(mfrow=c(2,2)) plot(...) This will put the next four plots all in the same window. Andrew Miles Department of Sociology Duke University On Sep 24, 2010, at 10:28 PM, Dennis Murphy wrote: Which one do

Re: [R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2010-09-25 Thread Peter Dalgaard
On 09/24/2010 10:41 PM, xin wei wrote: I am trying to reproduce the nice looking of Mandelbrot demonstrated by R wiki page by the following code: library(caTools)# external package providing write.gif function jet.colors = colorRampPalette(c(#7F, blue, #007FFF, cyan, #7FFF7F,

Re: [R] How to store regex expression in a variable

2010-09-25 Thread Peter Dalgaard
On 09/25/2010 03:45 AM, Yong Wang wrote: dear list I know how to store a regex expression in perl and ruby, no clue on R. I do read R regex manual , archives, and searched on line, still I need somebody help me out on how to store a regular expression in a variable. A regex is just a

Re: [R] Reading in .aux (ESRI raster files) into R

2010-09-25 Thread Barry Rowlingson
On Fri, Sep 24, 2010 at 3:21 PM, JoH jh...@york.ac.uk wrote: Error in readAsciiGrid(F:/GIS.LandcoverEuropeForRisk/Sept10kmmaps/Sp10KPointID.aux) :  object 'cellsize' not found My original data in Arc GIS is have a cell size an i'mm curious as to how to make sure all the details are

Re: [R] Power Function

2010-09-25 Thread jethi
hi, the part with the power function does not work. this is the gute function in my programm. because i´m not shure on what dependet my power function gute. and ofcourse the graphik does not work. thnx a lot:) regards Kaja Date: Fri, 24 Sep 2010 19:21:17 -0700 From:

[R] Measure Difference Between Two Distributions

2010-09-25 Thread Lorenzo Isella
Dear All, Suppose you are given two distributions (or better: two equally-sized lists of data); how can you evaluate the difference between them? I need something like an overlap measure of the two (let us say 0 == no overlap and 1== complete overlap). I should add that there is a 1-1

Re: [R] labels in (box)plot

2010-09-25 Thread Peter Ehlers
On 2010-09-21 8:23, Ivan Calandra wrote: Dear users, I would like all the ticks on a boxplot (x and y) to be labeled I have checked all the par() arguments but couldn't find what I'm looking for Here is an example to show it: df- structure(list(SPECSHOR = structure(c(1L, 1L, 1L, 3L, 3L, 3L,

[R] (no subject)

2010-09-25 Thread Kartija Oompragash
hi how can i plot now this function??? have to be m= 2??? because of the dimensions?thanks for ur help myfun - function(n, m, alpha = .05, seeder = 1000) { set.seed(seeder) x - matrix(rnorm(n, 0, 0.5), ncol = m) y - matrix(rnorm(n, 0, 0.8), ncol = m) l - diag(cor(x, y))

Re: [R] plot.ts versus plot.zoo

2010-09-25 Thread Achim Zeileis
On Wed, 22 Sep 2010, Alex van der Spek wrote: plot.ts has an argument yax.flip, plot.zoo does not. Thanks for the info. I've just added an yax.flip argument to plot.zoo in the devel version of zoo on R-Forge. hth, Z Is there a way to make the yaxis flip in plot.zoo? I tried using a

Re: [R] Measure Difference Between Two Distributions

2010-09-25 Thread Dennis Murphy
Hi: On Sat, Sep 25, 2010 at 3:47 AM, Lorenzo Isella lorenzo.ise...@gmail.comwrote: Dear All, Suppose you are given two distributions (or better: two equally-sized lists of data); how can you evaluate the difference between them? I need something like an overlap measure of the two (let us say

Re: [R] Measure Difference Between Two Distributions

2010-09-25 Thread Lorenzo Isella
On 09/25/2010 03:23 PM, Rainer M Krug wrote: Evaluate, for me, does not necessary mean test if they are significantly different, but rather to quantify the difference. If that is what you are looking for, you could look at the Earth Movers Distance, where a package is available at R-forge

[R] Uncertainty propagation

2010-09-25 Thread Maayt
I have a small model running under R. This is basically running various power-law relations on a variable (in this case water level in a river) changing spatially and through time. I'd like to include some kind of error propagation to this. My first intention was to use a kind of monte carlo

Re: [R] Measure Difference Between Two Distributions

2010-09-25 Thread Rainer M Krug
On Sat, Sep 25, 2010 at 3:53 PM, Lorenzo Isella lorenzo.ise...@gmail.comwrote: On 09/25/2010 03:23 PM, Rainer M Krug wrote: Evaluate, for me, does not necessary mean test if they are significantly different, but rather to quantify the difference. If that is what you are looking for, you

[R] OT: What distribution is this?

2010-09-25 Thread Rainer M Krug
Hi This is OT, but I need it for my simulation in R. I have a special case for sampling with replacement: instead of sampling once and replacing it immediately, I sample n times, and then replace all n items. So: N entities x samples with replacement each sample consists of n sub-samples

[R] margin control in lattice package

2010-09-25 Thread Jonathan Flowers
Hi all, I am difficulty with simple layout of plots in the lattice package I have created a series of levelplots and would like to plot them to a single device, but need to reduce the margin areas. This is easily accomplished with par(oma) and par(mar) in the base graphics package but I am

Re: [R] OT: What distribution is this?

2010-09-25 Thread Berwin A Turlach
G'day Rainer, On Sat, 25 Sep 2010 16:24:17 +0200 Rainer M Krug r.m.k...@gmail.com wrote: This is OT, but I need it for my simulation in R. I have a special case for sampling with replacement: instead of sampling once and replacing it immediately, I sample n times, and then replace all n

Re: [R] OT: What distribution is this?

2010-09-25 Thread Peter Dalgaard
On 09/25/2010 04:24 PM, Rainer M Krug wrote: Hi This is OT, but I need it for my simulation in R. I have a special case for sampling with replacement: instead of sampling once and replacing it immediately, I sample n times, and then replace all n items. So: N entities x samples

Re: [R] Measure Difference Between Two Distributions

2010-09-25 Thread Lorenzo Isella
ld represent the distance as the proportion of maximum possible distance, i.e. scaling it to be between 0 and 1. An example: A and B have the same length (x), and you calculate the emd(A, B), which is d. Now you have to determine the maximum distance between these two: remembering the analogy

Re: [R] Uncertainty propagation

2010-09-25 Thread Ben Bolker
Maayt m.lupker at hotmail.com writes: [snip] My first intention was to use a kind of monte carlo routine and run the model many times by changing the power law parameters. These power laws were obtained by fitting data points under R. I thus have std error associated to them: alpha (±da) *

Re: [R] Measure Difference Between Two Distributions

2010-09-25 Thread Rainer M Krug
On Sat, Sep 25, 2010 at 6:24 PM, Lorenzo Isella lorenzo.ise...@gmail.comwrote: ld represent the distance as the proportion of maximum possible distance, i.e. scaling it to be between 0 and 1. An example: A and B have the same length (x), and you calculate the emd(A, B), which is d. Now

[R] Help required

2010-09-25 Thread Malik Shahzad
Is it possible to read jpeg files into R? If yes please guide, Thanks.. I tried to search many time but failed to do. Thankis in advance.. with Best Regards, Malik Shahzad Visiting Researcher National Institute of Informatics (NII) Tokyo, Japan Doctoral Student Asian Institute of

Re: [R] apply union function vectorially

2010-09-25 Thread statquant2
Yes Thank you very much, NICE ONE. Do you have some interesting references about R (I do know some common books but may be you have some nice hidden books I have never heard about... ) -- View this message in context:

Re: [R] Measure Difference Between Two Distributions

2010-09-25 Thread Rainer M Krug
On Sat, Sep 25, 2010 at 3:16 PM, Dennis Murphy djmu...@gmail.com wrote: Hi: On Sat, Sep 25, 2010 at 3:47 AM, Lorenzo Isella lorenzo.ise...@gmail.com wrote: Dear All, Suppose you are given two distributions (or better: two equally-sized lists of data); how can you evaluate the

Re: [R] Help required

2010-09-25 Thread Ben Bolker
Malik Shahzad geomalik at live.com writes: Is it possible to read jpeg files into R? If yes please guide, Thanks.. I tried to search many time but failed to do. install.packages(sos) library(sos) findFn(read jpeg) (I initially tried findFn(import jpeg) and didn't get any hits, then

Re: [R] Fitting GLMM models with glmer

2010-09-25 Thread Ben Bolker
Clodio Almeida clodioalm at gmail.com writes: Hi everybody: [snip] I obtained the same results for parameters estimates and standarderrors, by using: glmer(cens ~ treat + heart + offset(log(SURVT) + (1 | INST), data=liver, family=poisson) It's nice that this check works. I would

Re: [R] Power Function

2010-09-25 Thread jethi
hey, how can i plot this function? n=1000 m=2 k=n/m N=100 myfun - function(n, m, alpha = .05, seeder = 1000) { l=matrix(0,nrow=m,ncol=N) for(i in 1:N){ set.seed(i) for(j in 1:m){ x=rnorm(n,0,0.5) y=rnorm(n,0,0.8) l[j,i]=cor((x[(((j-1)*k)+1):(((j-1)*k)+k)]), (y[(((j-1)*k)+1):(((j-1)*k)+k)])) } }

[R] 3D plot

2010-09-25 Thread jethi
hey, how can i plot this function??? thanks for ur help n=1000 m=2 k=n/m N=100 myfun - function(n, m, alpha = .05, seeder = 1000) { l=matrix(0,nrow=m,ncol=N) for(i in 1:N){ set.seed(i) for(j in 1:m){ x=rnorm(n,0,0.5) y=rnorm(n,0,0.8) l[j,i]=cor((x[(((j-1)*k)+1):(((j-1)*k)+k)]),

Re: [R] 3D plot

2010-09-25 Thread Steve Lianoglou
Hi Jethi, On Sat, Sep 25, 2010 at 3:42 PM, jethi kart...@hotmail.com wrote: hey, how can i plot this function??? thanks for ur help I don't really have the time (or inclination, sorry) to look through your code, but if it relates to your subject line, then there are several ways to plot 3d

Re: [R] 3D plot

2010-09-25 Thread jethi
hi steve, thnx for ur reply. but my problem is, that i have a matrix as a functions value and as a result i get a single number. so how can i plot this? and it would be nice if u read over my function, because i´m not sure if it correct. anyway thnx regards jethi -- View this message in

Re: [R] Help required

2010-09-25 Thread Prof Brian Ripley
On Sat, 25 Sep 2010, Malik Shahzad wrote: Is it possible to read jpeg files into R? If yes please guide, Thanks.. I tried to search many time but failed to do. On my system ??jpeg gave ReadImages::read.jpeg Read JPEG file biOps::readJpeg Read jpeg file rimage::read.jpeg

Re: [R] (no subject)

2010-09-25 Thread Tal Galili
Did you look at: ?curve Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English)

Re: [R] margin control in lattice package

2010-09-25 Thread Peter Ehlers
On 2010-09-25 8:59, Jonathan Flowers wrote: Hi all, I am difficulty with simple layout of plots in the lattice package I have created a series of levelplots and would like to plot them to a single device, but need to reduce the margin areas. This is easily accomplished with par(oma) and

[R] Question on levels function and extracting the associated level number

2010-09-25 Thread Jeffrey Cexun Cai
Dear Sir/Madam, I have a quick question, which I hope someone can help. I am using the levels function in R, which helps to summarize the number of factors that I have in a vector in an ordered manner. Using an already existing example: state - c(tas, sa, qld, nsw, nsw, nt, wa, wa,

Re: [R] 3D plot

2010-09-25 Thread jethi
hey, is there anybody who can help me? its very urgent because i have to send my bachelor thesis on monday. pls help me -- View this message in context: http://r.789695.n4.nabble.com/3D-plot-tp2713818p2713909.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Question on levels function and extracting the associated level number

2010-09-25 Thread Jorge Ivan Velez
Jeffrey, You can try as.numeric(state) [1] 6 5 4 2 2 3 8 8 4 7 2 7 4 4 5 6 5 3 8 7 4 2 2 8 5 1 2 7 7 1 HTH, Jorge On Sat, Sep 25, 2010 at 5:51 PM, Jeffrey Cexun Cai wrote: Dear Sir/Madam, I have a quick question, which I hope someone can help. I am using the levels function in

[R] Finding Zeros of a Function

2010-09-25 Thread Lorenzo Isella
Dear All, I need to find the (possible multiple) zeros of a function f within an interval. I gave uniroot a try, but it just returns one zero and I need to provide it with an interval [a,b] such that f(a)f(b)0. Is there any function to find the multiple zeros of f in (a,b) without constraints

[R] A little complex puzzle

2010-09-25 Thread Bill.Venables
I was looking for an example of complex variables in R. This one is trivial, but rather cute (though World War II aficionados may 'come over all funny'). See if you can guess the image before you try the function. It's not difficult. jif - function(res = 100) { z - sample(do.call(complex,

Re: [R] Finding Zeros of a Function

2010-09-25 Thread Jorge Ivan Velez
Dear Lorenzo, You could try the BB package: # function we need the roots for fn1 - function(x, a) - x^2 + x + a # plot curve(fn1(x, a = 5), -4, 4) abline(h=0, col = 2) # searching the roots in (-4, 4) # install.packages('BB') require(BB) BBsolve(par = c(-1, 1), fn = fn1, a = 5)

Re: [R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2010-09-25 Thread xin wei
hi, peter: thank you for your attention. adding the line you suggested did display the static Mandelbrot plot with good resolution on R graphics device. However, the resulting gif file still come out ugly. the R wiki page I was referring to is the following:

[R] formatting data for predict()

2010-09-25 Thread Andrew Miles
I'm trying to get predicted probabilities out of a regression model, but am having trouble with the newdata option in the predict() function. Suppose I have a model with two independent variables, like this: y=rbinom(100, 1, .3) x1=rbinom(100, 1, .5) x2=rnorm(100, 3, 2) mod=glm(y ~ x1 +

Re: [R] Finding Zeros of a Function

2010-09-25 Thread Berend Hasselman
You may also try package nleqslv, which uses Newton or Broyden to solve a system of nonlinear equations. It is an alternative to BB. Without further information from your side, no additional information can be provided. /Berend -- View this message in context: