Displaying 4 results from an estimated 4 matches for "pierrelap".
2009 Apr 05
5
Use a value from a different model
Hello,
I cannot find the issue and it drives me crazy :(
let''s simplify. I have 2 models: saving and purchase_type
a *saving* corresponds to a *purchase_type* e.g. new sourcing or
renegotiation
a saving has exactly one purchase_type and a purchase_type has many
savings.
when I try to display the list of savings and their purchase type
(name, not Id), i get the dreaded "You have a
2007 Feb 11
2
Extract NULL column in a matrix e.g. matrix[,-NULL]
Hello,
I need to remove columns in a matrix. The number of columns varies from 0
to n. I can't figure out how to specify the zero case.
aa <-matrix(runif(5^2),5,5)
#remove column 3
aa[,-3]
#remove no column
aa[,-NULL]
Error in -NULL : invalid argument to unary operator
I know I could use ifelse, but it would complicate my model a lot. Is there
a direct way to
2005 Jun 28
1
Index (which) of last non-NA data in dataframe
Hello,
In a dataframe, I want the index if the last non-NA data. Example:
d<-data.frame(matrix(c(1,3,4,2,7,8,1,NA,2),3,3,byrow=TRUE))
gives:
> d
X1 X2 X3
1 1 3 4
2 2 7 8
3 1 NA 2
I want a vector that gives me 3 2 3
I know about tail and which, but I don't know how not to consider the NA
e.g.: last<-tail(d,1,na.rm=TRUE) still gives me a NA
2007 Feb 19
1
Need to find most likely betas
Hello,
I have a particular situation where a single "wrong" observation is
impacting the results of a traditional regression to the point that
betas become unreliable. I need a way to calculate the most likely
betas. Here's an example:
set.seed(1)
unknownbeta <- matrix(seq(100,500,100),25,5,byrow=TRUE)
x <-matrix(runif(25*5),25)
y <- rowSums(unknownbeta*x)