similar to: Fit t distribution

Displaying 20 results from an estimated 600 matches similar to: "Fit t distribution"

2004 Feb 18
2
using names() as a variable in a formula
Greetings List, I'm having some trouble with the use of the names function in a formula. Below is an example of something that works (i.e first line), and the second line is the same formula which doesn't. I want to be able to reference the column of the dataC table so I can run the variogram iteratively with a loop. > v<-variogram(A1~1,loc=~x+y, dataC) >
2009 Jun 22
3
Calculating "row standard deviations"
Hi R-helpers, I have been struggling with calculating row and column statistics, e.g. standard deviation. I know that > datac$Mean<-rowMeans(datac,na.rm=TRUE) will give me row means. I have tried to replicate those row means with the apply function: > datac$Mean2<-apply(datac,2,mean) so that I can replace the function argument with "sd" (instead of mean) to get standard
2008 Dec 02
1
Left-truncated regression
Hi. I am looking for a function for left-truncated data. I have one data set with 2 variables (Hours~Yrs_Ed). I already left-censored the data at 200 and left-truncated it at the same spot, so that I am able to make 2 estimations (one for censoring and one for truncation). I know how to make the linear regression for the left-censored variable (hours) and how to plot the regression line into the
2008 Apr 25
3
Use of survreg.distributions
Dear R-user: I am using survreg(Surv()) for fitting a Tobit model of left-censored longitudinal data. For logarithmic transformation of y data, I am trying use survreg.distributions in the following way: tfit=survreg(Surv(y, y>=-5, type="left")~x + cluster(id), dist="gaussian", data=y.data, scale=0, weights=w) my.gaussian<-survreg.distributions$gaussian
2009 Jan 04
1
POSIXct and chron issues with tz
Dear All- I am trying to merge two data files - they have different date formats and different times zones. I need to match up the date/time of the datasets and then invoke a conditional statement, such as: if dataC$mph is >= 12 then keep dataM$co23 for the corresponding time/date stamp. snippets of data files: *dataC.txt* LST in mph Deg DegF DegF2 % volts Deg
2010 Dec 07
2
robustbase problem [bug?] in adjbox function.
hello list, i'm a bit puzzled by the error message i get when i copy past this in R:
2008 Mar 03
1
Problem plotting curve on survival curve
Calum had a long question about drawing survival curves after fitting a Weibull model, using pweibull, which I have not reproduced. It is easier to get survival curves using the predict function. Here is a simple example: > library(survival) > tfit <- survreg(Surv(time, status) ~ factor(ph.ecog), data=lung) > table(lung$ph.ecog) 0 1 2 3 <NA> 63 113 50 1
2012 Oct 19
1
Looping survdiff
The number of recent questions from umn.edu makes me wonder if there's homework involved.... Simpler for your example is to use get and subset. dat <- structure(..... as found below var.to.test <- names(dat)[4:6] #variables of interest nvar <- length(var.to.test) chisq <- double(nvar) for (i in 1:nvar) { tfit <- survdiff(Surv(time, completion==2) ~
2006 Jan 19
2
Tobit estimation?
Folks, Based on http://www.biostat.wustl.edu/archives/html/s-news/1999-06/msg00125.html I thought I should experiment with using survreg() to estimate tobit models. I start by simulating a data frame with 100 observations from a tobit model > x1 <- runif(100) > x2 <- runif(100)*3 > ystar <- 2 + 3*x1 - 4*x2 + rnorm(100)*2 > y <- ystar > censored <- ystar <= 0
2007 Jul 05
3
Loop and function
Hi All, I am trying to make a loop for a function and I am using the following codes. "p" and "var" are some matrix obtained before. I would like to apply the function "gpdlow" for i in 1:12 and get the "returnlow" for i in 1:12. But when I ask for "returnlow" there are warnings and it turns out some strange result. for (i in 1:12){ gpdlow
2007 Jun 19
2
Histogram
Hello, I am using the following codes to plot a histogram and density line for x. For the density line, I just want it to show the two tails, eg, for x larger than 0.05 ans smaller than -0.05 hist (x, seq(-0.1,0.1,0.01),freq = FALSE) lines (density(x,bw="SJ"), x> 0.05 & x< (-0.05), col = "red") But is does not work, can anyone give me some advice? -- View this
2007 Dec 03
2
Linear Regression, Data is a list
Hello, I would like to perform a linear regression and the data is a list.e.g lm(list$abc~., data=list) or lm(abc~., data=list), which would give the same result. The problem is I would like to call the response variable in a more general form. What I try to achieve is sth like lm(list$(paste("a","b","c"))~., data=list), but it does not work. Could anyone give me
2007 Oct 02
5
Linear Regression
Hello, I would like to fit a linear regression and when I use summary(), I got the following result: Call: lm(formula = weight ~ group - 1) Residuals: Min 1Q Median 3Q Max -1.0710 -0.4938 0.0685 0.2462 1.3690 Coefficients: Estimate Std. Error t value Pr(>|t|) groupCtl 5.0320 0.2202 22.85 9.55e-15 *** groupTrt 4.6610 0.2202 21.16 3.62e-14
2009 Feb 09
2
CMD check puzzle
I am getting an error that I don't understand from R CMD check on my current instance of the survival code. R2.7.1 on Linux. Here is the last of the log * checking line endings in Makefiles ... OK * checking for portable use of $BLAS_LIBS ... OK * creating survival-Ex.R ... OK * checking examples ... OK * checking tests ... make[1]: Entering directory
2007 Jun 19
2
Function -return value
Hi, I am trying to write a function with the following codes and I would like it to return the values for "alpha beta para parab " seperately. Then I would like to use this funstion for "variable" with factor "a" and "b". But the result turns out to be a matrix with element like "Numeric,2" ... I guess they are just the values for
2011 Oct 23
0
code review: is it too much to ask?
Hello all, I really appreciate how helpful the people in this list are. Would it be too much to ask to send a small script to have it peer-reviewed? to make sure I am not making blatant mistakes? The script takes an experiment.dat as input and generates system Throughput using ggplot2. It works now ... [sigh] but I have this nasty feeling that I might be doing something wrong :). Changing
2007 Jul 10
3
ECDF, distribution of Pareto, distribution of Normal
Hello all, I would like to plot the emperical CDF, normal CDF and pareto CDF in the same graph and I amusing the following codes. "z" is a vector and I just need the part when z between 1.6 and 3. plot(ecdf(z), do.points=FALSE, verticals=TRUE, xlim=c(1.6,3),ylim=c(1-sum(z>1.6)/length(z), 1)) x <- seq(1.6, 3, 0.1) lines(x,pgpd(x, 1.544,0.4373,-0.2398), col="red") y
2007 Jul 03
4
sequences
Hi, I would like to generate a series in the following form (0.8^1, 0.8^2, ..., 0.8^600) Could anyone tell me how can I achieve that? I am really new to R. -- View this message in context: http://www.nabble.com/sequences-tf4019146.html#a11414836 Sent from the R help mailing list archive at Nabble.com.
2007 Jun 29
2
cbind
Hi, I have a series of return data, a and b are factors. I would like to build a matrix which contains each vector of "returns". I am thinking about something as following, but I guess there should be a sensible way of doing this. returns <- split(return, list(regimef, assetf)) cbind(returns[[1]], returns[[2]],...,returns[[n]]) Could anyone give me some advice? Many thanks. --
2007 Sep 17
2
vector name
I have got a list named "filtered", I would like to construct alist named "fdata" as following: fdata <- cbind(matrix(unlist(filtered),ncol=28), myregime) If I try names(filtered), it gives all the correct name for each vector, but if I try names(fdata), it appears "filtered[[1]]" "filtered[[2]]" ..., How can I keep the name in "fdata"?