Displaying 20 results from an estimated 90 matches similar to: "coerce mode list?"
2009 Sep 28
1
help with lda function
I am having a problem understanding the lda package. I have a dataset here:
[,1] [,2] [,3]
[1,] 2.95 6.63 0
[2,] 2.53 7.79 0
[3,] 3.57 5.65 0
[4,] 3.16 5.47 0
[5,] 2.58 4.46 1
[6,] 2.16 6.22 1
[7,] 3.27 3.52 1
If I do the following;
"names(d)<-c("y","x1","x2")
d$x1 = d$x1 * 100
d$x2 = d$x2 * 100
g<-lda( y ~ x1 + x2, data=d)
v2
2012 Jun 04
1
simulation of modified bartlett's test
Hi, I run this code to get the power of the test for modified bartlett's
test..but I'm not really sure that my coding is right..
#normal distribution unequal variance
asim<-5000
pv<-rep(NA,asim)
for(i in 1:asim)
{print(i)
set.seed(i)
n1<-20
n2<-20
n3<-20
mu<-0
sd1<-sqrt(25)
sd2<-sqrt(50)
sd3<-sqrt(100)
g1<-rnorm(n1,mu,sd1)
g2<-rnorm(n2,mu,sd2)
2009 Sep 29
1
help with lda function from MASS package
Thanks David,
Yes, I am talking about the MASS package.Thank you for pointing out that
these scale the same. My question is, how do I get from the V1 data:
V1
1 164.4283
2 166.2492
3 170.5232
4 156.5622
5 127.7540
6 136.7704
7 136.3436
to the other set of data:
+ 1 -2.3769280
+ 2 -2.7049437
+ 3 -3.4748309
+ 4 -0.9599825
+ 5 4.2293774
+ 6 2.6052193
+ 7 2.6820884
On Mon, Sep 28, 2009
2006 Jan 11
3
SPSS and R ? do they like each other?
... and is there also such a nice tool (like spss.get) for exporting
data frames to SPSS? write.table does not keep the data frame labels -
neither did the other exporting tools that I found.
Thanks!
Michael
[[alternative HTML version deleted]]
1998 Nov 16
1
PB Mandeville can't be reached
# Peter B. Mandeville kindly offered to send me code for Hotelling's T^2
# Test. Unfortunately there seems to be no route to his machine.
# So i'm trying to reach him via the Mailing List.
------------------------------------------------------------------------
Sir,
this morning i recieved your message about the availability of the code
for Hotelling's Test. I hurried to find out
2000 Sep 21
2
adjacency matrix
Hi all;
I have two vectors A=c(5,2,2,3,3,2)
and B=c(2,3,4,5,6,1,3,2,4,3,1,5,1,4,6,1,4)
and I want to make the following matrix
using the information I have from the above
vectors.
0 1 1 1 1 1
1 0 1 0 0 0
0 1 0 1 0 0
1 0 1 0 1 0
1 0 0 1 0 1
1 0 0 1 0 0
so the first vector says that I have 6
elements therefor I have to make a
6 by 6 matrix and then I have to read
5 elements from the
1998 Nov 16
0
Re: Hotelling corrected
By accident, I left out the lines defining n1 and n2. Here it is as a
function.
Peter B.
hotelling <- function(d1,d2){
k <- ncol(d1)
n1 <- nrow(d1)
n2 <- nrow(d2)
xbar1 <- apply(d1,2,mean)
xbar2 <- apply(d2,2,mean)
dbar <- xbar2-xbar1
v <- ((n1-1)*var(d1)+(n2-1)*var(d2))/(n1+n2-2)
t2 <- n1*n2*dbar%*%solve(v)%*%dbar/(n1+n2)
f <-
2010 Feb 13
3
how to do calculations in data matrices?
Please give me just a reference where I can find something useful.
In summary, I need to :
- find the median of each row of a matrix
- create a new matrix with each value in the first matrix divided by the median of its row
- if a value "a" in the second matrix is < 1, I need to substitute it with 1/a
I know that for some of you it must be overeasy, but I swear I googled for two
2009 Jun 16
4
confusion on levels() function, and how to assign a wanted order to factor levels, intentionally?
Dear R-helpers,
I want to make a series of boxplots on several numeric univariates with two
group variables (species and population, population nested in species, and
with population as the X-axis). In order to get a proper order of the
individual populations in X-axis, I need to assign a wanted order to the
factor (population). I used the levels() function to do this assignment, but
it seemed
2004 Apr 27
0
lmRobMM vs rlm
I am needing some expertise with regard
to the S-Plus command lmRobMM and its R counterpart
rlm(formula,data,method="MM")
I have used lmRobMM(formula,data) in S-Plus on the Stackloss data and
obtained for my residuals
6.217777 1.150717 6.427946 8.174019 -0.6713005 -1.248641 -0.4236203
0.5763797 -1.057899 0.3593823
11 12 13 14 15 16
2012 May 23
1
numerical integration
Greetings,
Sorry, the last message was sent by mistake! Here it is again:
I encounter a strange problem computing some numerical integrals on [0,oo).
Define
$$
M_j(x)=exp(-jax)
$$
where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products
$$
A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx
$$
Analytically we have
$$
A_{ij}=1/(a(i+j)).
$$
In the code below we compute the matrix
2007 Apr 17
1
predict.ar() produces wrong SE's (PR#9614)
Full_Name: Kirk Hampel
Version: 2.4.1
OS: Windows
Submission from: (NULL) (144.53.251.2)
Given an AR(p) model, the last p SE's are wrong.
The source of the bug is that the C code (ver 2.4.0) assumes *npsi is the length
of the psi vector (which is n+p), whilst the predict.ar function in R passes out
as.integer(npsi), where npsi <- n-1.
Some R code following reproduces the error. Let p=4,
2004 Dec 29
1
Discrepancy between intervals.lme and coef.lme
I'm using R on Windows v2.0.1 with the nlme package (v3.1-53) and am finding some unexpected discrepancies in the output of intervals.lme and coef.lme. I've included a toy dataset at the end, but briefly, the data are longitudinal data from couples in marital therapy. Each spouse's relationship satisfaction is measured 4 times; I've fit both linear and quadratic models to the
2006 Apr 03
2
Fast way of finding new position for model object?
I have a model object that acts as a list. The position of each object
is determined by two factors: number of votes ascending and age of
object descending. When a user adds or deletes a vote I need to
quickly update the associated model object''s position. Right now this
is done with the following method:
def update_position
position = nil
Bug.find(:all, :order =>
2012 May 23
0
numerical integrals
Greetings,
I encounter a strange problem computing some numerical integrals on [0,oo).
Define
$$
M_j(x)=exp(-jax)
$$
where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products
$$
A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx
$$
Analytically we have
$$
A_{ij}=1/(a(i+j)).
$$
In the code below we compute the matrix $A_{i,j}$, $1\leq i,j\leq 5$, numerically
and check against the known
2008 Jul 11
1
Suggestion: 20% speed up of which() with two-character mod
Hi,
by replacing 'll' with 'wh' in the source code for base::which() one
gets ~20% speed up for *named logical vectors*.
CURRENT CODE:
which <- function(x, arr.ind = FALSE)
{
if(!is.logical(x))
stop("argument to 'which' is not logical")
wh <- seq_along(x)[ll <- x & !is.na(x)]
m <- length(wh)
dl <- dim(x)
if (is.null(dl)
2006 Oct 09
2
hello, acts_as_ferret questions, any help greatly appreciate
hi, ive been reading up on ferret, acts_as_ferret, and other search
plugins for rails.
after reading about ferret, i found out about the acts_as_ferrt plugin.
my first question about acts_as_ferret:
1. from reading about ferret, do i still need to manually save the IDX
and add a IDX column field to my model table for acts_as_ferret to work?
they say that acts_as_ferret handles everything,
2007 Oct 22
30
TST is right out
Hi Zed,
I checked in a pure-Ruby URI classifier to Mongrel trunk. Ola''s Java
port of the TST had some bug, and I don''t think it''s necessary in the
first place. The Ruby classifier is around 25 lines instead of the
400-odd lines for the C extension and the 200-odd for the Java
extension. It uses a Regexp which is perhaps shady:
@matcher = Regexp.new(routes.map do
2010 Jun 14
9
Multipart forms by default?
Forms without explicit enctype are submitted as application/x-www-form-
urlencoded. This is the default behaviour in Rails. However, this
enctype does not allow transmission of binary data (files).
Would it not make sense to specify the enctype multipart/form-data by
default instead? i.e. all the form_for helpers would add this enctype
to the form tag, unless overriden by the developer.
This
2008 Jul 25
0
glht after lmer with "$S4class-" and "missing model.matrix-" errors with DATA
maybe it's in the data? So here it comes.
> sv.growth
Grouped Data: length ~ meas | box_id
meas spec comp water box_id sprouts leaves length
long.sprout
1 1 Sv control moist 1 8.800000 37.80 211.2000
60.6
2 1 Sv xfull moist 2 7.000000 8.00 174.8000
62.8
3 1 Sv control moist 3 9.000000