Re: [R] combining mathematical notation and value substitution

2003-06-21 Thread Uwe Ligges
Faheem Mitha wrote: Monotonic Multigamma run ( * n == len * , * theta == t1 * Is this a valid expression? My understanding of an expression is that it contains one more more statements. That's only part of the expression. This is the full expression Monotonic Multigamma run ( * n == len * ,

[R] Beginner's Question on Linear Regression Models

2003-06-21 Thread J Ireland
Hi Folks, Could anyone point me to a good reference on linear regression models? Specifically, I am trying to gain an intuitive feel for how the standard error values are calculated for the parameter estimates. My understanding is that these are computed using the variance-covariance

Re: [R] Beginner's Question on Linear Regression Models

2003-06-21 Thread John Fox
Dear James, A very nice way of understanding these matters intuitively is to express them geometrically using data and confidence ellipses (for two predictors and their coefficients) and ellipsoids (more generally). The same ideas apply to linear hypotheses, such as for the difference between

Re: [R] error functions

2003-06-21 Thread Prof Brian Ripley
Yes, statisticians call the natural versions of the cumulative normal distribution, pnorm. As I recall erf(x) = 2 * pnorm(x * sqrt(2)) - 1 erfc(x) = 2 * pnorm(x * sqrt(2), lower=FALSE) On Sat, 21 Jun 2003, Salvatore Barbaro wrote: does anybody know if R contains error functions like erf

Re: [R] Silhouette question

2003-06-21 Thread Martin Maechler
BDR == Prof Brian Ripley [EMAIL PROTECTED] on Sat, 21 Jun 2003 06:44:00 +0100 (BST) writes: BDR ?try is your friend here. Yes, but Jonck's real problem is the use of an outdated version of the cluster package (yes: package, *not* library). Which proves that he is certainly *not*

[R] optim with contraints

2003-06-21 Thread Adelchi Azzalini
There seems to exist peculiar cases where optim does not take care of constraints on the parameters to be optimized over. The call to optim is of the form opt - optim(cp, fn=sn.dev, gr=sn.dev.gh, method=L-BFGS-B, lower=c(-Inf, 1e-10, -0.99527), upper=c( Inf, Inf,

Re: [R] optim with contraints

2003-06-21 Thread Spencer Graves
Adelchi: Permit me to add to Prof. Ripley's comments: If you want to know how to get around this kind of problem, I will tell you that I would modify the definition of cp to send the constraints to +/-Inf. Functions like optim tend to work better with unconstrained problems than

Re: [R] Beginner's Question on Linear Regression Models

2003-06-21 Thread Andrew Perrin
John Fox was kind enough to reply, but didn't recommend IMHO the best book on regression models: his own, John Fox, _An R and S-Plus Companion to Applied Regression_, Sage, 2002. ap -- Andrew J Perrin -

Re: [R] combining mathematical notation and value substitution

2003-06-21 Thread Faheem Mitha
On Sat, 21 Jun 2003, Uwe Ligges wrote: Faheem Mitha wrote: Can you go into a little more detail here about why alpha here is a call? Thomas already told it and ?expression says as well: expression returns a vector of mode expression containing its arguments as unevaluated ``calls''.

[R] Using weighted.mean() in aggregate()

2003-06-21 Thread Aleksey Naumov
Dear R users, I have a question on using weighted.mean() while aggregating a data frame. I have a data frame with columns Sub, Length and Slope: x[1:5,] Sub LengthSlope 1 2 351.547 0.0025284969 2 2 343.738 0.0025859390 3 1 696.659 0.0015948968 4 2 5442.338 0.0026132544 5

Re: [R] Using weighted.mean() in aggregate()

2003-06-21 Thread Spencer Graves
tstdf - data.frame(Sub =rep(1:2, 2), + Length=1:4, Slope=11:14) by(tstdf, tstdf$Sub, + function(x)weighted.mean(x$Slope, x$Length)) tstdf$Sub: 1 [1] 12.5 tstdf$Sub: 2 [1] 13.3 Does this answer your question? hth. spencer graves