search for: dickgiess

Displaying 18 results from an estimated 18 matches for "dickgiess".

Did you mean: dickgiesser
2007 Jan 08
4
Export dataframe to txt
Hi all, Is there a function to export a dataframe to a text file? I want to store a large set of data which I have saved in a dataframe in my workspace and copy and past doesn't cut it. Thank you, Benjamin
2006 Oct 26
4
Header of dataframe
Hi I am fairly new to R and I would appreciate some help to hopefully a trivial problem. I created a function: summary.aggregate <- function(y, ...) { temp.mean <- aggregate(y, FUN=mean, ...) temp.sd <- aggregate(y, FUN=sd, ...) temp.length <- aggregate(y, FUN=length, ...) temp <- data.frame(cbind(mean=temp.mean$x,stdev=temp.sd$x,n=temp.length$x)) } this outputs e.g.:
2007 Mar 14
4
abs(U) > 0 where U is a vector?
Hi, I am looking for a way to compare if every element of a vector is > 0. i.e. while(abs(U) > 0) { .. } is there a function for this or do I have to write one? I'd appreciate your help! Benjamin
2007 Jan 08
3
Speeding things up
Hi, is it possible to do this operation faster? I am going over 35k data entries and this takes quite some time. for(cnt in 2:length(sdata$date)) { if(sdata$value[cnt] < sdata$value[cnt - 1]) { sdata$ddtd[cnt] <- sdata$ddtd[cnt - 1] + sdata$value[cnt - 1] - sdata$value[cnt] } else sdata$ddtd[cnt] <- 0 } return(sdata) Thank you, Benjamin
2007 Jan 15
4
How to format R code in LaTex documents
Hi, I am planning on putting some R script in an appendix of a LaTex document. Can anyone recommend me a way of how to format it? Is there a way to keep all line breaks without having to insert \\ in every single line? Thank you! Benjamin
2007 Jan 09
2
Logical operations or selecting data from data.frames
Hi all, why doesn't something like this does not work? speedy <- (sdata$VaR < sdata$DdtdAbs) && sdata$DdtdDuration >= qpois(pct,lambda) && sdata$Ddtd > MinDD or sdata$Ddtd[sdata$Ddtd > 0 && sdata$VaR < sdata$DdtdAbs] sdata looks like this: dataId date value Ddtd VaR DdtdAbs DdtdDuration 18948 79637 2004-07-27 10085.10
2006 Nov 07
2
Boxplot
Hi, I am new to R and am still trying to get a grip of it. I have data in this format: Run Lab Batch Y 1 1 1 1 608.781 2 2 1 2 569.670 3 3 1 1 689.556 4 4 1 2 747.541 5 5 1 1 618.134 6 6 1 2 612.182 7 7 1 1 680.203 8 8 1 2 607.766 9 9 1 1 726.232 and I want to make a boxplot of the Y values for each
2006 Nov 20
1
Basic R timeseries data manipulation
Hi, suppose I have a time series rt. Why does this code not work? rt <- data n <- length(rt) - 2 at <- vector(length = n) at = rt-(3.75101e-04 + 9.61877e-02 * rt[-1] - 2.48071e-02 * rt[-2]) Thank you, Benjamin
2007 Feb 18
1
Help with pair plot
Hi, I'm trying to create a plot using pair. Currently I'm doing the following pairs(~mpg + hp + wt , data=cars, labels = c("Miles per Gallon","Horsepower","Weight"),pch = c(24,25)[unclass(cars$tr + 1)], bg = c("red", "green3")[unclass(cars$tr + 1)],panel=panel.smooth) for the attached dataset. However,instead of using panel.smooth I
2007 Mar 16
1
Create coef.table as in summary.glm (with Signif. codes)
Hi, how do I create a coef.table as for example returned by summary.glm? I don't see where the significance codes are assigned during summary.glm. Thank you, Benjamin
2007 Feb 17
1
Constraint maximum (likelihood) using nlm
Hi, I'm trying to find the maximum (likelihood) of a function. Therefore, I'm trying to minimize the negative likelihood function: # params: vector containing values of mu and sigma # params[1] - mu, params[2]- sigma # dat: matrix of data pairs y_i and s_i # dat[,1] - column of y_i , dat[,2] column of s_i negll <- function(params,dat,constant=0) { for(i in 1:length(dat[,1])) {
2007 Jan 14
2
ks.test not working?
Hi, I am trying the following: library(ismev) library(evd) fit <- gev.fit(x,show=FALSE) ks.test(x,pgev,fit$mle[1],fit$mle[2],fit$mle[3]) but I am getting: Warning message: cannot compute correct p-values with ties in: ks.test(x, pgev, fit$mle[1], fit$mle[2], fit$mle[3]) where x is: [1] 239 38 1 43 22 1 5 9 15 6 1 9 156 25 3 100 6 [18] 5 100
2006 Nov 10
1
Value at Risk historical simulation
Hi Has someone got a package/script at hand to do a historical simulation to calculate the Value at Risk? If your not sure what Historical Simulation is: In simple terms, Historical Simulation (HS) is just taking sample percentiles over a moving sample. Suppose we want to use HS to predict a portfolio's Value-at-Risk at a confidence level of 99 percent and the window size is chosen to be 250
2006 Oct 26
0
Generating tables
...hink colnames(DF)<-c("meanname","sdname","nname") should work if > that's what you want. > > > > -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Benjamin > Dickgiesser > Sent: Thursday, October 26, 2006 1:08 PM > To: r-help at stat.math.ethz.ch > Subject: [R] Header of dataframe > > Hi > I am fairly new to R and I would appreciate some help to hopefully a > trivial problem. > > I created a function: > > summary.aggregate <- f...
2006 Nov 07
1
Better way to create tables of mean & standard deviations
Hi I'm trying to create tables of means, standard deviations and numbers of observations (i) for each laboratory (ii) for each batch number (iii) for each batch at each laboratory for the attached data. I created these functions: summary.aggregate <- function(y, label, ...) { temp.mean <- aggregate(y, FUN=mean, ...) temp.sd <- aggregate(y, FUN=sd, ...) temp.length <-
2006 Nov 21
0
Expanding VaR package
Hi, it would be nice if the VaR package could get expanded to work with more models. I wrote a function which calculates the VaR for a Garch(1,1) AR(2) model. Since I am fairly new to R I am sure it can be written much neater. If someone feels like having a go, here is what I have written library(fSeries) library(tseries) VaR.Garch <- function(data,stockId=1,p=0.01,dt=1) { r <-
2006 Dec 14
1
Fit Frechet Distribution
Hi everyone, is there a function to fit a frechet distribution? The only thing I found is gev.fit from ismev which fits a generalized extreme value distribution (if shape>1 => Frechet) . Is there a function to only fit a frechet? Thank you Benjamin
2006 Oct 25
1
Drawing a reference line for a qqplot with reference to Weibull distribution
Hi, I'm trying to create a qqplot with reference to a Weibull distribution including a reference line. This is my current code: lights.data <- scan("lights.dat") #Generate Weibull quantiles prob.grid <- ppoints(length(lights.data)) prob.quant <- qweibull(prob.grid , 1.5,4) #Draw QQ plot qqplot(prob.quant,lights.data) #add red reference line qqline(lights.data,col = 2)