Displaying 2 results from an estimated 2 matches for "subset_data".
2012 Sep 26
1
Ask for help - how to change WHIRR.117.csv to WHIRR_117.csv
Hi,
I have a script below.
dat <- read.table(file="pt.csv", header=T, sep=",", row.names=1,
col.names=1)
dat
for(which_col in seq_len(ncol(dat)))
{
subset_data <- dat[,which_col:ncol(dat)]
file_name <- sprintf('%s.csv', colnames(dat)[which_col])
write.csv(subset_data, file_name)
message(sprintf('Saving %s', file_name))
}
dput(head(dat))
structure(list(WHIRR.25 = c(0L, 0L, 0L, 0L, 0L, 0L), WHIRR.28 = c(0L,
0L, 1L,...
2013 Jan 12
1
Question on broken-line regression: 'segmented' or alternative
...d", lty=2)
#Regression for group 3 without breakpoints (green, solid line)
reg_3.1 <- lm(data[which(data$group==3),3]~data[which(data$group==3),2])
abline(reg_3.1, col="green", lty=1)
#Segmented package to estimate breakpoints and determine slopes for
group2 and 3:
subset_data <- subset(data, subset=data$group!=3)
names(subset_data) <- c("sub_group", "sub_x", "sub_y")
attach(subset_data)
X <- model.matrix(~0+sub_group)*sub_x
time.1 <- X[,1]
time.2 <- X[,2]
time.3 <- X[,3]
olm <- lm(sub_y~0 +...