Displaying 12 results from an estimated 12 matches for "flyhyena".
2007 Nov 13
7
combine two dataframe
I have two data frame A and B adn want to cross them.
A has format as:
a1 a2 a3
1 2 3
2 3 1
1 3 2
...
B:
b1 b2
1 2
2 1
...
the combine result shall be something like
a1 a2 a3 b1 b2
1 2 3 1 2
1 2 3 2 1
2 3 1 1 2
2 3 1 2 1
1 3 2 1 2
1 3 2 2 1
....
is there a function able of doing this instead of loops?
Thanks,
Sun
2006 Aug 31
6
newbie question about index
Hi,
I am trying to convert a variable a = sample(1:3,100,rep = T) represents choices into a 3X100 dummy varible b with corresponding element set to 1 otherwise 0.
eg.
a: 1 3 2 1 2 3 1 1....
b: 1 0 0 1 0 0 1 1..
0 0 1 0 1 0 0 0...
0 1 0 0 0 1 0 0...
Is there something like b[a] =1 existing? I could not figure this out myself.
---------------------------------
2008 Jan 11
3
filtering data frame based on two columns
Hi,
I have a data frame df with column names a,b and c.
Now I want to get a subset of df that satified the condition a == 1 and b
== 2, how do I specify this.
For one condition like a == 1 I can use subdf = df[,df$a==1] to get the
right answer, but
subdf = df[,df$a==1 && df$b ==2] does not return the right answer.
Some quick tips please.
2007 Oct 09
2
AlgDesign--exact and approximate design
Hi
I am trying to generate a design using Algdesign and came across terms of
"exact design" and "approxiamte theory design", I did not find a reference
to explain what they are, could some one shed some light about this on me?
Another question is, I want to measure the main effects and at least two
interactions, variables are factors, how do I ensure this in formula,
2008 Mar 05
3
regex sulotion for seperating number and string
I have strings contain postcode and letters, some seperated with blank, some
with comma, and some hasn't seperated. eg, "2324gz" "2567 HK" "3741,BF"
I want to seperate the number and letters into two new variables.
I know this should be quite basic question, but searched on regex syntax and
that seems a bit scarey to me, any one can shot me a quick solution
2007 Oct 10
2
how to generate and evaluate a design using Algdesign
Hi,
I have some problems when using AlgDesign->optFederov() generating
designs.
I have 6 variables, all factors. 3^2 and 4^4, I want to have a design that
can take care of main effects and two interactions within 2 pair of
variables v3-v4 and v5-v6, the following is the code
################
require(AlgDesign)
set.seed(1)
levels = c(v1=3,v2=3, v3=4,v4=4,v5=4,v6=4)
2007 Oct 24
3
convert factor dataframe into numeric matrix
Bear me if this is a naive question.
I have a dataframe, all lists inside it are factors. When I use
as.matrix(df) to convert, I get a character matrix while my intention is to
get numeric matrix. I can make the convertion iteratively by each list but
I do think there is some more elegant way of doing this.
please let me know if I missed somthing there.
Thanks in advance.
Sun
2007 Feb 06
15
R in Industry
The other day, CNN had a story on working at Google. Out of curiosity, I
went to the Google employment web site (I'm not looking, but just
curious). In perusing their job posts for statisticians, preference is
given to those who use R and python. Other languages, S-Plus and
something called SAS were listed as lower priorities.
When I started using Python, I noted they have a portion of the
2008 Mar 19
1
R CMD SHLIB errors
I got errors when I tried to compile my code into dll on XP box.
"C:/R/R-2.6.2/src/gnuwin32/MkRules:235: warning: overriding commands for
target `.c.d'
C:/R/R-2.6.2/src/gnuwin32/MkRules:223: warning: ignoring old commands for
target `.c.d'
C:/R/R-2.6.2/src/gnuwin32/MkRules:255: warning: overriding commands for
target `.c.o'
C:/R/R-2.6.2/src/gnuwin32/MkRules:243: warning:
2007 May 11
0
EM covergence problem
Hi, R users
I am trying to use EM algorithmto estimate a latent class model of discrete choice. The basic model is a logit model which has two variables X=(X1,X2) and the utility is defined as v = Beta*X. There are 3 classes of individuals each has its own Beta values, so Beta is a 3*2 matrix. For each individual, (there are 1000), he make a choice between two randomly generated choice
2008 Apr 13
4
R equivalent of erfcinv in matlab
I am converting some matlab code into R that use inverse of the
complementary error function, erfcinv and did not find an equivalent in
R, is there such a function in some contributed modules?
Thanks.
2009 Mar 14
2
SEM model testing with identical goodness of fits
HI,
I am testing several models about three latent constructs that
measure risk attitudes.
Two models with different structure obtained identical of fit measures
from chisqure to BIC.
Model1 assumes three factors are correlated with each other and model
two assumes a higher order factor exist and three factors related to
this higher factor instead of to each other.
Model1:
model.one