Hi,
I have a regression model, where the explanatory variables are factors,
and I want to include interaction terms, but some combinations occur in
the data very infrequently.
Hence, I'm using hclust and cutree to hierarchically cluster the levels,
and get new combined levels to regress on.
Why do you keep posting something to which you have already received an
answer?
https://stat.ethz.ch/pipermail/r-help/2008-April/158662.html
answered in
https://stat.ethz.ch/pipermail/r-help/2008-April/158664.html
and repeated at
https://stat.ethz.ch/pipermail/r-help/2008-April/158787.html
and
Here is a demo you may like to consider. (I can see what you are trying
to do with your loops, but I prefer to do it this way.)
On 32 bit Windows, (which I am forced to use), your seed is not a valid
integer, so I have changed it to something which is.
set.seed(7658943)
fph - 0.4
Sigh -
I've noticed an increasing tendency for people to use '=' rather than
the older '-' symbol. When '=' became available as an assignment
operator in S-PLUS in the late '90s my first reaction was to switch to
it as well. Brian Ripley warned me that it was not a good idea. As
usual he was right,
Oops! Sorry! Accept my apologies. I've sent this message to the wrong list.
Best regards,
Ricardo
[Ricardo Rodriguez] Your XEN ICT Team wrote:
Those are good news.
Prof Brian Ripley wrote:
You didn't tell us the version of R. quartz() is different in 2.7.0
alpha, and there the
Dear Spencer Graves,
Thank you for your comments and suggestions.
I knew that the true optimum values are about (0.69, 0.0, 0.0, -0.3, 0.3,
2.3, -3.0 ,-3.0). That's why I used these values as starting values.
Nonetheless, the last three estimates are so bad.
Regards,
Kathryn Lord
Those are good news.
Prof Brian Ripley wrote:
You didn't tell us the version of R. quartz() is different in 2.7.0
alpha, and there the function arguments do work (and the size is
really as advertised and not at a notional 72dpi). In fact, it is a
much more standard device and interface,
Dear R Experts,
This is the 2nd time in the chat room. Its a great place to get help from R
experts.
I have a data frame problem, it contains thousands of data.
part of it, I am giving for explaining the problem
date day x yz
82 1989-04-28 Fri 2118.0 2418.80 33713
Hi,
It's more a vector question. Try this one:
f
function( x, test = is.na(x) | x == 0 ){
out - x[!test][ cumsum(!test) ]
if(test[1]) out - c(NA,out)
out
}
f( c(1,0,2,1,0) )
[1] 1 1 2 1 1
f( c(1,0,2,1,0, NA) ) # missing values are also replaced
[1] 1 1 2 1 1 1
f( c(0,1,0,2,1,0)
MORE GENERAL OPTIM ISSUES
I'm considering creating a package 'optimMLE' that would automate
some of this and package it with common 'methods' that would assume that
sum(fn(...)) was either a log(likelihood) or the negative of a
log(likelihood), etc. However, before I do, I need to
Bill.Venables at csiro.au writes:
I've noticed an increasing tendency for people to use '=' rather than
the older '-' symbol. When '=' became available as an assignment
operator in S-PLUS in the late '90s my first reaction was to switch to
it as well. Brian Ripley warned me that it was
try to use method L-BFGS-B and give boudary condition to the parameters in
use so that the algorithm search is limited to a particular region as it
seems u have to many parameters.
On Fri, 4 Apr 2008 22:10:20 -0700 (PDT) kathie wrote:
Dear R users,
I used to OPTIM to
Using Latex and the beamer class, I would like to highlight code snippets.
Does anybody know a suitable 'preprocessor' or 'filter' for R (and/or C/C++)
code ?
I have been including it in simple \begin{verbatim} ... \end{verbatim} and I
know there is a better way -- in fact I saw it used a while
Hi!
I am an R beginer, so perhaps this is a quite simple question...
After using the lmer command (under the lme4 package) for fitting a mixed
model, it was impossible to use de command plot(model) for checking model
adequacy. R returns this message: Error in as.double(y) : cannot type '%s'
Need idiot's guide to installing R on Mac 10.3.9.
Thanks.
BJ
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal,
On Sun, Apr 6, 2008 at 9:04 AM, saikat sarkar [EMAIL PROTECTED] wrote:
This is the 2nd time in the chat room. Its a great place to get help from R
experts.
I assume you are referring to this email list. I am not aware of
a chat room but if it exists that is something different from this
list.
Cristian Carranza wrote:
Hi!
I am an R beginer, so perhaps this is a quite simple question...
After using the lmer command (under the lme4 package) for fitting a mixed
model, it was impossible to use de command plot(model) for checking model
adequacy. R returns this message: Error in
Hello all and thanks in advance for any advice.
I am very new to R and have searched my question but have not come up with
anything quite like what I would like to do.
My problem is:
I have a data set for individuals (rows) and values for behaviours
(columns). I would like to know the
Hi,
is there an elegant way to use 'substitute' with '...' arguments?
My first try was this:
f1 - function(...) substitute(...)
f1( 2+7, foo, 3+5 )
2 + 7
As you can see, substitute acts only on the first argument. So I tried
f2 - function(...) substitute(list(...))
f2( 2+7, foo, 3+5
Bill.Venables at csiro.au writes:
Here is a demo you may like to consider. (I can see what you are trying
to do with your loops, but I prefer to do it this way.)
This is just for pedagogical purpose,
so I like to keep the simple-minded 'for'
loop.
But what I really wonder is why do I not
On 6 April 2008 at 10:40, Dirk Eddelbuettel wrote:
| Using Latex and the beamer class, I would like to highlight code snippets.
| Does anybody know a suitable 'preprocessor' or 'filter' for R (and/or C/C++)
| code ?
|
| I have been including it in simple \begin{verbatim} ... \end{verbatim} and I
I would greatly appreciate if anybody can tell me if an R code is available for
computing the eta measure of association in contingency tables.
With regards
-
[[alternative HTML version deleted]]
__
Hello,
I have a data with hexdecimal. But GNU R convert it to strange number. How
can I get that hexdecimal showing in the R-table?
---
-- My Data-Table:
Sender_ID Receiver_ID Other_ID
6565
On Apr 6, 2008, at 10:35 AM, Ben Bolker wrote:
Bill.Venables at csiro.au writes:
I've noticed an increasing tendency for people to use '=' rather than
the older '-' symbol. When '=' became available as an assignment
operator in S-PLUS in the late '90s my first reaction was to
switch to
On Sun, 6 Apr 2008, Simon Anders wrote:
Hi,
is there an elegant way to use 'substitute' with '...' arguments?
My first try was this:
f1 - function(...) substitute(...)
f1( 2+7, foo, 3+5 )
2 + 7
As you can see, substitute acts only on the first argument. So I tried
f2 -
Hello,
I have a data with hexdecimal. But GNU R convert it to strange number. How can
I get that hexdecimal showing in the R-table?
-
My Data-Table:
Sender_ID Receiver_ID Other_ID
6565
Dear Edwin,
There's a distinction between the way in which a number is stored
internally and the way in which it's printed. R is reading the hex
numbers correctly but is printing them in decimal. You can assign the
class hexmode to the vector containing the data and then it will
print in hex:
Dear R users,
I want to perform an exact permutation of multisets. I have looked at the
coin package, but it doesn't seem to offer what I am looking for. I want to
perform permutations (exact - without duplications) on multisets of scalars
(e.g., the multiset 0,0,1,2,2). I want to output all the
You can use the function permutation from the e1071 package,
then
library(e1071)
multisetperm - function(multiset) {
unique(apply(matrix(multiset[permutations(length(multiset))],
ncol=length(multiset)), 1, paste, sep=, collapse=)) }
multisetperm(c(0, 0, 1, 2, 2))
The output would look
Hi Charles,
Charles C. Berry wrote:
Try this:
f2 - function(...) sapply( substitute(list(...)), deparse )[-1]
Wow, this works. Thanks a lot!
p.s. Why do you want this as mode character?
For the usual purpose of 'substitute': to label something. The use case
is that I have a
You may be interested in the heplots package for multivariate linear
models. For a multivariate regression, it plots a data ellipse of the
predicted values (H matrix) together with a data ellipse of the
residuals (E ellipse). H is scaled so that it protrudes outside the E
ellipse iff the
Le dim. 6 avr. à 14:44, Dirk Eddelbuettel a écrit :
On 6 April 2008 at 10:40, Dirk Eddelbuettel wrote:
| Using Latex and the beamer class, I would like to highlight code
snippets.
| Does anybody know a suitable 'preprocessor' or 'filter' for R (and/
or C/C++)
| code ?
|
| I have been
Hi,
If I understand you correctly, there is beta code within the development
version of package 'vegan' on R forge to do this.
install.packages(vegan, repos=http://R-Forge.R-project.org;)
Then:
numPerms(5)
[1] 120
perms - allPerms(5, observed = TRUE)
perms[1:10,]
[,1] [,2] [,3] [,4]
Hi all,
I'm running the program sem on a Mac, but I'm getting a message that I think
is quite general. The error reads
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
scan() expected 'a real', got '10652)'
The 10652 is the sample size coming
Hi Folks,
A while ago (September 2007) I set up an experimental
Debian 4.0 Etch installation, and installed R on it,
along with several packages -- including e1071 and
the Bundle VR -- by means of the Debian package
manager. Most of the time, R works fine. But not always.
Just now, I wanted to
Colleagues
I am working in a Linux OS with R 2.6.2.
I need to execute a telnet session to another Linux machine from R,
perform some operations, then return to the original computer. When I
am in an R session, this is easy to accomplish by typing:
system(telnet -l username
Dear Steven,
The prob package does this, too. (Please see the * fix below).
x - c(0, 0, 1, 2, 2)
library(prob)
A - permsn(x, 5) # with repeated columns
B - unique( data.frame( t(A) )) # no repeated rows
The data frame B will have 56 rows and 5 columns. If you need the
There may well be neater ways to do this, but if you have only a
limited number of zeros in any run, this is probably as quick as
any. Suppose your data frame is 'dat':
fixCol - function(x) {
y - x
n - length(x)
while(any(zx - x == 0)) {
y - c(NA, y[-n])
David Kaplan wrote:
Hi all,
I'm running the program sem on a Mac, but I'm getting a message that I
think
is quite general. The error reads
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
scan() expected 'a real', got '10652)'
The 10652
Thank you Matthieu for your helpful suggestions.
Unfortunately I still have problems.
I have tried to compile it via your suggestion.
this is strange... you should have the usual summary...
I have on my machine
library(urca)
test2-ur.df(nottem, type=none, lags=1)
summary(test2)
When I type in
Dear John,
Thank you.
Is there any possibility to get original stored number printed.
Because i have another coloum like:
Protocol
TCP
This is gonna cause probleme (as you notice before).
I dont really understand what you mean with a list. i am new with R.
Thanks,
Edwin
Am Sonntag,
The documentation for predict.gam in library mgcv gives an example of using
an lpmatrix to do approximate prediction via interpolation. However, the
code is specific to the example wrt the number of smooth terms, df's for
each,etc. (which is entirely appropriate for an example)
Has anyone
On 6 April 2008 at 23:58, (Ted Harding) wrote:
| Hi Folks,
| A while ago (September 2007) I set up an experimental
| Debian 4.0 Etch installation, and installed R on it,
| along with several packages -- including e1071 and
| the Bundle VR -- by means of the Debian package
| manager. Most of the
Dear Edwin,
On Mon, 7 Apr 2008 01:14:35 +0100
Edwin Sendjaja [EMAIL PROTECTED] wrote:
Dear John,
Thank you.
Is there any possibility to get original stored number printed.
R is a programming language, so you could in principle read an input
line as character data, break it into its
Don't use telnet, use rsh or (better) ssh. You can set up your identity on the
remote host so that ssh doesn't ask for your password (see ssh
documentation), and you can give ssh the command(s) that should be executed
on the remote host (again see ssh documentation).
Claus
On Sunday 06 April
David Kaplan wrote:
Yea, I checked that, but that wasn't the problem. I'm sending the input
and
a much smaller file. It's in .csv format. The input is for the Mac, and
I'm beginning to think it might be a Mac issue. The program input lines
come from John Fox's program sem
Thanks, I'm not sure why it wasn't saved as a .csv. I posted it to the R
Mac list and the general R list because in the past when I've posted to the
R Mac list I was told it wasn't a R question. Because this problem didn't
appear with the windows verson of R, I wasn't sure
I want to include a vignette with a package I wrote. I did follow the
Writting R extentions document step by step, but went I run Rcmd build,
an error occurs. It goes like this:
* creating vignettes ... ERROR
.
.
.
.
:7: Emergency stop
L7L == Fatal error occurred, no output PDF file
Leyla Biondini wrote:
I have installed Package: r-cran-urca (1.1-6-1) [universe] from the ubuntu
website for use in Windows.
Whatever made you believe that that would work?
If you are using Windows, just install urca via the Packages menu in the
Rgui.
--
O__ Peter Dalgaard
François Aucoin wrote:
I want to include a vignette with a package I wrote. I did follow the
Writting R extentions document step by step, but went I run Rcmd build,
an error occurs. It goes like this:
* creating vignettes ... ERROR
.
.
.
.
:7: Emergency stop
L7L == Fatal error
Currently I invoke:
foo - read.table(foo.data, header=TRUE)
to read a table into foo
Then when I try to plot a histogram out of the 5th column of foo:
hist(foo[5])
It fails and it says:
Error in hist.default(foo[5]) : 'x' must be numeric
Then I tried:
typeof(foo[5])
[1] List
So how can I
try
hist(foo[,5])
plot(foo[,c(1,5)])
HTH
Currently I invoke:
foo - read.table(foo.data, header=TRUE)
to read a table into foo
Then when I try to plot a histogram out of the 5th column of foo:
hist(foo[5])
It fails and it says:
Error in hist.default(foo[5]) : 'x' must be
Hi
Is anyone aware if there is a function already available that calculates the
between-groups COvariance matrix, say in a discriminant analysis setting, or in
a manova setting.
Maybe as a helper function to some other major function.
Otherwise I would have to program it myself (probably
53 matches
Mail list logo