You're minimizing the log likelihood, but you want to minimize the *negative*
log likelihood. Also, optimize() is better than optim() if you have a
function of only one argument.
Replace
Jon Moroney wrote:
>
> #Create the log likelihood function
> LL<-function(x) {(trials*log(x))-(x*sumvect)}
If your goal is to get the distance between geographic points, you might try
computing the distance along the "great circle arc" and forget about
projection. Several packages have functions that do this. See
https://stat.ethz.ch/pipermail/r-help/2007-October/144546.html.
hope that helps,
Ian
try
sum(a > b)
sum(b > a)
sum(a == b)
Ian
nedmt60 wrote:
>
> i have
>
> a = rpois (10, x)
> b = rpois (10, y)
>
> what is the code to show that a>b, b>a and a=b to show just the number of
> occurances?
> at the moment when I type a>b I get a nice long list of true or false.
>
--
www.rseek.org is the best solution to this that I have found.
Ian
kynn wrote:
>
> Hi! I'm new to R programming, though I've been programming in other
> languages for years.
>
> One thing I find most frustrating about R is how difficult it is to use
> Google (or any other search tool) to loo
If you are developing packages, the Eclipse plugin StatET is excellent. You
get all of the fancy coding features of Eclipse plus many useful tools
specifically for R package building. Combining this with the SVN plugin
subclipse has been a fantastic combination for me.
Ian Fiske
--
View this
Christophe Genolini wrote:
>
>
> In order to optimize the code, I would like to write myFunc in C. Is it
> possible, in the C code, to call a function define in R (dist1 or dist2)
> that will be send to myFunc as an argument ?
>
> Christophe
>
>
You want to read section 5.11: "Evaluating
Ricardo Arias Brito wrote:
>
> Dear All,
>
> Is posible calculate Std. Error for glm as lm, using
> cov(hat beta) = phi * solve(t(X) %*% hat W %*% X)^-1
> on R? Who is hat W and phi output glm?
>
> y=rpois(20,4)
> fit.glm <- glm(y ~ x, family=poisson
> summary(fit.glm)
>
> Fitted to a model g
I think that you want the the @nord tag which is in development. I am eager
for the release of the Roxygen version with this tag too!
See their mailing list on R-Forge for more details on this.
cheers,
Ian
Ken-JP wrote:
>
> I don't want any zoo.Rd to be generated - I am a user of the library
You want to set the "names" attribute of your results vector. You can do
this with the names() function (see ?names). Specifically, you might use
something like this:
results <- c(se, upper, lower, cv)
names(results) <- c("se", "upper", "lower", "cv")
Good luck,
Ian
Stropharia wr
t(wt,mpg,data=mtcars) + stat_smooth(fill="grey50")
I even tried the Cairo library as one R-help post suggested, but to no
avail.
Any suggestions?
Thanks much,
Ian Fiske
--
View this message in context:
http://www.nabble.com/ggplot%3A-problem-with-fill-option-in-stat_smooth%28%29-tp218323
You might try the cut() function to convert your data from a continuous
measure into an ordinal factor. Then use the table() function to get your
contingency table.
The R help system is very extensive. Type "?cut" to get the help on the
function cut(). This works with all functions. Look at t
Try:
table(k)[rank(unique(k))]
-ian
Armin Meier wrote:
>
> Hi all,
> I've a vector with entries, which are all of the same type, e.g. string:
> k <- c("bb", "bb", "bb", "aa", "cc", "cc")
> and want to create a second vector containing the number of each entry
> in k in the same order as in k,
AM, hadley wickham wrote:
> On Wed, Feb 4, 2009 at 9:12 AM, Ian Fiske wrote:
>>
>> Hi all,
>>
>> I am using ggplot2 and continuing to find it very useful and pretty.
>> However, I am trying to create some graphics for publication that would be
>> included i
2009 at 12:55 PM, hadley wickham wrote:
> On Wed, Feb 4, 2009 at 10:55 AM, Ian Fiske wrote:
>> Thanks for the suggestion, Hadley. I tried:
>>
>> stat_smooth(fill=alpha("grey",1))
>>
>> and got the same problem. The shaded band shows up in the graphi
open the pdf in Inkscape http://www.inkscape.org/ and
> export it as a .emf or .png ?
>
> Etienne
>
> Ian Fiske a écrit :
>
> Hi all,
>
> I am using ggplot2 and continuing to find it very useful and pretty.
> However, I am trying to create some graphics for publication
To handle the correlations, you can treat individuals as random blocks. So
you have a mixed model with measurement technique crossed with measured
attribute and random intercepts for each individual. You can fit this with
lmer() in the lme4 package. Keep in mind there are a number of variations
The problem comes from mixing up general linear model (LM) theory to compute
B with the classical anova estimators. The two methods use different
approaches to solving the normal equations. LM theory uses any generalized
inverse of X'X to solve the normal equations. Yours comes from ginv() whic
If your matrix is called mat, how about
mat[which(mat[,2] > 0), ]
mat[which(mat[,2] < 0), ]
-Ian
mentor_ wrote:
>
> Hi,
>
> I have a matrix with negative and positiv values.
> How can I get either the negative or positive values from the matrix?
>
> Matrix:
> [,1] [,2]
> [1,]1
Try the functions Anova() or linear.hypthesis() in the package "car". If
using Anova(), you probably want the type II table.
Ian Fiske
dl7631 wrote:
>
> Hello!
>
> I've run a simple linear model: result<-lm(DV~A+B+C,data=Data)
>
> My Data$A,Da
19 matches
Mail list logo