Displaying 4 results from an estimated 4 matches for "fxa".
Did you mean:
fax
2008 Feb 10
1
Using 'sapply' and 'by' in one function
...icients from multiple
models by a grouping variable. I think that I'm missing something
that is probably obvious to experienced users.
Here's a simple (trivial) example of what I'd like to do:
new <- data.frame(Outcome.1=rnorm(10),Outcome.2=rnorm(10),sex=rep(0:1,5),Pred=rnorm(10))
fxa <- function(x,data) { lm(x~Pred,data=data)$coef }
sapply(new[,1:2],fxa,new) # this yields coefficients for the
predictor in separate models
fxb <- function(x) {lm(Outcome.1~Pred,da=x)$coef};
by(new,new$sex,fxb) #yields the coefficient for Outcome.1 for each sex
## I'd like to be ab...
2012 Dec 06
1
Fuction Error
...TRUE)) # use this to clear data
library(quantmod)
library(PerformanceAnalytics)
symbols <-
c('XLE','XLV','XLI','XLU','XLP','IYZ','XLK','XLY','XLF','XLB','GLD','SLV','E
FA','EEM','FXA','FXE','FXY','HYG','LQD', '^GSPC')
getSymbols(symbols,from='2007-01-01')
getSymbols('SPY',from='2007-01-01')
SP500 <- Cl(SPY)
colnames(SP500)[1] <- 'SPY'
#Function to build a dataframe form a list of symbols
sym...
2008 Feb 11
0
Testing for differecnes between groups, need help to find the right test in R. (Kes Knave)
...cients from multiple
models by a grouping variable. I think that I'm missing something
that is probably obvious to experienced users.
Here's a simple (trivial) example of what I'd like to do:
new <-
data.frame(Outcome.1=rnorm(10),Outcome.2=rnorm(10),sex=rep(0:1,5),Pred=r
norm(10))
fxa <- function(x,data) { lm(x~Pred,data=data)$coef }
sapply(new[,1:2],fxa,new) # this yields coefficients for the
predictor in separate models
fxb <- function(x) {lm(Outcome.1~Pred,da=x)$coef};
by(new,new$sex,fxb) #yields the coefficient for Outcome.1 for each sex
## I'd like to be ab...
2005 Aug 09
43
Some patches.
Hi,
in my path of getting the controls sample to work nicely, I fixed some
classes on the way, see the attached diffs. I had some difficulties, but
could track down all stupid bugs and am now almost happy with the code
:)
(I had the complete ImageHandler hieracy implemented at some time, but
than I discovered the error was not in unloaded ImageHandlers but in the
controls-program which does not