[R] unique combinations

2011-12-21 Thread Antje Niederlein
Hi there, I have a vector and would like to create a data frame, which contains all unique combination of two elements, regardless of order. myVec <- c(1,2,3) what expand.grid does: 1,1 1,2 1,3 2,1 2,2 2,3 3,1 3,2 3,3 what I would like to have 1,1 1,2 1,3 2,2 2,3 3,3 Can anybody help? _

Re: [R] How to find position in bin-data?

2011-03-19 Thread Antje Niederlein
Thanks a lot! That's what I was looking for :-) A On 19 March 2011 13:56, Duncan Murdoch wrote: > On 11-03-19 8:18 AM, Antje Niederlein wrote: >> >> Hi there, >> >> probably there is a very simple solution, but I cannot think of one... >> >>

[R] How to find position in bin-data?

2011-03-19 Thread Antje Niederlein
Hi there, probably there is a very simple solution, but I cannot think of one... I have a vector with values: data <- c(1,6,3,4,8,4,2,9) and I have a vector with bin breaks: bins <- c(1,3,5,7,9,11) Now, I'd like to get for each data point the index of the bin-vector where the value falls in (

Re: [R] model fine, predict gives an error

2011-03-16 Thread Antje Niederlein
y look > but you need to post data so people can determine if they > can produce and fix your problem. Any complaints > about bad/ singular matricies are likely to depend on data > being bad in some way. > > > > >> >> >> >> >> On 15 March 2011

Re: [R] model fine, predict gives an error

2011-03-16 Thread Antje Niederlein
Anybody who can help me with this issue? On 15 March 2011 14:15, Antje Niederlein wrote: > Hi there, > > I try to model some dose response curves (drc-package). In most cases > it is fine but now I got some data which produces me the following > error: > > load("drm

[R] model fine, predict gives an error

2011-03-15 Thread Antje Niederlein
Hi there, I try to model some dose response curves (drc-package). In most cases it is fine but now I got some data which produces me the following error: load("drmData.RData") library(drc) drmObj <- drm(value ~ concentration, cmpd_respvar, data = drmData, fct = LL.4()) predict(drmObj) >> Error

Re: [R] Console output

2011-02-21 Thread Antje Niederlein
9 >> > > --- > > In principle, the lower bound (10) for the width option could be > lowered a bit more, as I think 10 had been a somewhat arbitrary > choice protecting useRs from hanging themselves.. > > Martin > > >    > Ted. > >    > On 21-Feb-11 10

[R] Console output

2011-02-21 Thread Antje Niederlein
Hi there, I though there has been a possibility to force the output on the console with one element per line. Instead of this: > 1:10 [1] 1 2 3 4 5 6 7 8 9 10 something like this > 1:10 [1] 1 [2] 2 [3] 3 [4] 4 [5] 5 [6] 6 [7] 7 [8] 8 [9] 9 [10] 10 Can anybody help

Re: [R] fitdistr question

2011-02-11 Thread Antje Niederlein
things and I'm not sure whether I got it right how to find the ML-function of a more complex distribution... Antje On 11 February 2011 10:14, Ingmar Visser wrote: > Antje, > > On Fri, Feb 11, 2011 at 9:58 AM, Antje Niederlein > wrote: >> >> Hi Ingmar, hi Dennis, &g

Re: [R] fitdistr question

2011-02-11 Thread Antje Niederlein
ML estimate of lambda is the mean, so no need for (iterative) > optimization. See eg: > http://mathworld.wolfram.com/MaximumLikelihood.html > hth, Ingmar > > On Fri, Feb 11, 2011 at 8:52 AM, Antje Niederlein > wrote: >> >> Hello, >> >> I tried to fit a pois

[R] fitdistr question

2011-02-10 Thread Antje Niederlein
Hello, I tried to fit a poisson distribution but looking at the function fitdistr() it does not optimize lambda but simply estimates the mean of the data and returns it as lambda. I'm a bit confused because I was expecting an optimization of this parameter to gain a good fit... If I would use mle(

Re: [R] question mle again

2011-02-08 Thread Antje Niederlein
ke in how to use mle() correctly. I think, I'll look into Bens mle2() method and figure out whether this is a more elegant way :-) Ciao, Antje On 7 February 2011 21:39, Ben Bolker wrote: > Antje Niederlein yahoo.de> writes: > >> >> A few day ago, I was looking f

[R] question mle again

2011-02-07 Thread Antje Niederlein
A few day ago, I was looking for an answer to my question but didn't get one. Anybody who can help now? Hello, I tried to use mle to fit a distribution(zero-inflated negbin for count data). My call is very simple: mle(ll) ll() takes the three parameters, I'd like to be estimated (size, mu and

[R] mle question

2011-02-07 Thread Antje Niederlein
Hello, is there somebody who can help me with my question (see below)? Antje > On 1 February 2011 09:09, Antje Niederlein wrote: >> Hello, >> >> >> I tried to use mle to fit a distribution(zero-inflated negbin for >> count data). My call is very simple: &

Re: [R] mle question

2011-02-07 Thread Antje Niederlein
Hello, is there somebody who can help me with my question (see below)? Antje On 1 February 2011 09:09, Antje Niederlein wrote: > Hello, > > > I tried to use mle to fit a distribution(zero-inflated negbin for > count data). My call is very simple: > > mle(ll) >

[R] mle question

2011-02-01 Thread Antje Niederlein
Hello, I tried to use mle to fit a distribution(zero-inflated negbin for count data). My call is very simple: mle(ll) ll() takes the three parameters, I'd like to be estimated (size, mu and prob). But within the ll() function I have to judge if the current parameter-set gives a nice fit or not.

Re: [R] Warning with mle

2011-01-28 Thread Antje Niederlein
Hi Ben, thanks a lot for your answer. > There are four reasonable solutions to your problems: > > 1. ignore the warnings, as long as they are all of the > same type (NaNs/NAs being produced by dbinom or dpois), > and as long as the final results look sensible. probably fine for me. The fit for

Re: [R] Warning with mle

2011-01-28 Thread Antje Niederlein
Hi Ben, thanks a lot for your answer. > There are four reasonable solutions to your problems: > > 1. ignore the warnings, as long as they are all of the > same type (NaNs/NAs being produced by dbinom or dpois), > and as long as the final results look sensible. probably fine for me. The fit for

[R] Warning with mle

2011-01-27 Thread Antje Niederlein
Hi there, I'm pretty new to the field of fitting (anything). I try to fit a distribution with mle, because my real data seems to follow a zero-inflated poisson distribution. So far, I tried a simple example to see whether I understand how to do it or not: # example count data x <- 0:10 y <- dpois