Displaying 3 results from an estimated 3 matches for "thesedata".
2009 Oct 28
3
variable labels to accompany data.frame
...omedata$DATA is a dataframe that contains the data, and somedata$VARIABLE is also
a dataframe, but serves as the codebook. For instance, the following function creates a template
into which one could subsequently edit to insert variable labels and turn into somedata$VARIABLE.
fnJunk <-function( THESEDATA ) {
# From a dataframe, make the start of a codebook.
if(!is.data.frame(THESEDATA)) stop("!is.data.frame(THESEDATA)")
data.frame(
Variable=names(THESEDATA)
, class=sapply(THESEDATA, class)
, type=sapply(THESEDATA, typeof)
, label=""
,...
2007 Jan 26
1
bootstrap bca confidence intervals for large number of statistics in one model; library("boot")
...parameters and for the fitted
values at 50 levels of the predictor.
set.seed(1234567)
x<-runif(150)
y<-2/3 + pi * x^2 + runif(length(x))/2
plot(x,y)
DAT<-data.frame(x,y)
NEWDATA<-data.frame(x=seq(min(x), max(x), length=50))
library('boot')
myfn<-function(data, whichrows) {
TheseData<-data[whichrows,]
thisLM<-lm( y~poly(x,2), data=TheseData)
thisFit<-predict(thisLM, newdata=NEWDATA)
c(
coef(summary(thisLM))[,"Estimate"]
, thisFit)
}
bootObj<-boot( data=DAT, statistic=myfn, R=1000 )
names(bootObj)
dim(bootObj$t)
sofar<-t(sapply( 1:ncol(bootObj$t),...
2002 Aug 07
1
No subject
I've got a table of 1 row per observation.
16 questions * n subjects * 4 classrooms (2 teachers * 2 conditions)
I'd like to run some simple regressions that look something like this:
lm(length ~ elapsed)
I'd like to do the regressions several times, split out by
questionkey, student, class. What I've been doing is using a series
of which's to create new data sets (e.g.