similar to: (no subject)

Displaying 20 results from an estimated 2000 matches similar to: "(no subject)"

2006 Sep 18
1
non linear modelling with nls: starting values
Hi, I'm trying to fit the following model to data using 'nls': y = alpha_1 * beta_1 * exp(-beta_1 * x) + alpha_2 * beta_2 * exp(-beta_2 * x) and the call I've been using is: nls(y ~ alpha_1 * beta_1 * exp(-beta_1 * x) + alpha_2 * beta_2 * exp(-beta_2 * x), start=list(alpha_1=4, alpha_2=2, beta_1=3.5, beta_2=2.5), trace=TRUE, control=nls.control(maxiter =
2009 Jun 16
1
turning off escape sequences for a string
Hello, I would like to create a matrix with one of the columns named $\delta$. I have also created columns $\beta_1$ , $\beta_2$, etc. However, it seems like \d is an escape sequence which gets automatically removed. (Using these names such that they work right in xtable -> latex) colnames(simpleReg.mat) <- c("$\beta_1$","$SE(\beta_1)$", "$\beta_2$",
2013 Oct 19
2
ivreg with fixed effect in R?
I want to estimate the following fixed effect model: y_i,t = alpha_i + beta_1 x1_t + beta_2 x2_i,tx2_i,t = gamma_i + gamma_1 x1_t + gamma_2 Z1_i + gamma_3 Z2_i I can use ivreg from AER to do the iv regression. fm <- ivreg(y_i,t ~ x1_t + x2_i,t | x1_t + Z1_i + Z2_i, data = DataSet) But, I'm not sure how can I add the fixed effects. Thanks! [[alternative HTML
2012 Feb 21
0
BHHH algorithm on duration time models for stock prices
I am currently trying to find MLE of a function with four parameters. My codes run well but i don't get the results. I get the following message: BHHH maximisation Number of iterations: 0 Return code: 100 Initial value out of range. I don't know this is so because of the way i have written my loglikelihood or what. The loglikelihood LogLik<-function(param){ beta_1<-param[1]
2018 Feb 16
2
[FORGED] Re: SE for all levels (including reference) of a factor atfer a GLM
On 16/02/18 15:28, Bert Gunter wrote: > This is really a statistical issue. What do you think the Intercept term > represents? See ?contrasts. > > Cheers, > Bert > > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom
2018 Feb 16
0
SE for all levels (including reference) of a factor atfer a GLM
This is really a statistical issue. What do you think the Intercept term represents? See ?contrasts. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Feb 15, 2018 at 5:27 PM, Marc Girondot via R-help < r-help at
2011 Apr 12
2
Testing equality of coefficients in coxph model
Dear all, I'm running a coxph model of the form: coxph(Surv(Start, End, Death.ID) ~ x1 + x2 + a1 + a2 + a3) Within this model, I would like to compare the influence of x1 and x2 on the hazard rate. Specifically I am interested in testing whether the estimated coefficient for x1 is equal (or not) to the estimated coefficient for x2. I was thinking of using a Chow-test for this but the Chow
2013 Feb 25
3
Empirical Bayes Estimator for Poisson-Gamma Parameters
Dear Sir/Madam, I apologize for any cross-posting. I got a simple question, which I thought the R list may help me to find an answer. Suppose we have Y_1, Y_2, ., Y_n ~ Poisson (Lambda_i) and Lambda_i ~Gamma(alpha_i, beta_i). Empirical Bayes Estimator for hyper-parameters of the gamma distr, i.e. (alpha_t, beta_t) are needed. y=c(12,5,17,14) n=4 What about a Hierarchal B ayes
2018 Feb 16
2
SE for all levels (including reference) of a factor atfer a GLM
Dear R-er, I try to get the standard error of fitted parameters for factors with a glm, even the reference one: a <- runif(100) b <- sample(x=c("0", "1", "2"), size=100, replace = TRUE) df <- data.frame(A=a, B=b, stringsAsFactors = FALSE) g <- glm(a ~ b, data=df) summary(g)$coefficients # I don't get SE for the reference factor, here 0:
2011 Aug 19
3
Calculating p-value for 1-tailed test in a linear model
Hello, I'm having trouble figuring out how to calculate a p-value for a 1-tailed test of beta_1 in a linear model fit using command lm. My model has only 1 continuous, predictor variable. I want to test the null hypothesis beta_1 is >= 0. I can calculate the p-value for a 2-tailed test using the code "2*pt(-abs(t-value), df=degrees.freedom)", where t-value and degrees.freedom
2006 Oct 31
2
Put a normal curve on plot
I would like to be able to place a normal distribution surrounding the predicted values at various places on a plot. Below is some toy code that creates a scatterplot and plots a regression line through the data. library(MASS) mu <- c(0,1) Sigma <- matrix(c(1,.8,.8,1), ncol=2) set.seed(123) x <- mvrnorm(50,mu,Sigma) plot(x) abline(lm(x[,2] ~ x[,1])) Say I want to add a normal
2005 Dec 01
2
Minimizing a Function with three Parameters
Hi, I'm trying to get maximum likelihood estimates of \alpha, \beta_0 and \beta_1, this can be achieved by solving the following three equations: n / \alpha + \sum\limits_{i=1}^{n} ln(\psihat(i)) - \sum\limits_{i=1}^{n} ( ln(x_i + \psihat(i)) ) = 0 \alpha \sum\limits_{i=1}^{n} 1/(psihat(i)) - (\alpha+1) \sum\limits_{i=1}^{n} ( 1 / (x_i + \psihat(i)) ) = 0 \alpha \sum\limits_{i=1}^{n} (
2013 Apr 30
0
Ridge regression
Hi all, I have run a ridge regression on a data set 'final' as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617 smallest value of GCV at 10 I think it
2007 Aug 15
1
Polynomial fitting
Hi everybody! I'm looking some way to do in R a polynomial fit, say like polyfit function of Octave/MATLAB. For who don't know, c = polyfit(x,y,m) finds the coefficients of a polynomial p(x) of degree m that fits the data, p(x[i]) to y[i], in a least squares sense. The result c is a vector of length m+1 containing the polynomial coefficients in descending powers: p(x) = c[1]*x^n +
2005 Nov 24
1
residuals in logistic regression model
In the logistic regression model, there is no residual log (pi/(1-pi)) = beta_0 + beta_1*X_1 + ..... But glm model will return residuals What is that? How to understand this? Can we put some residual in the logistic regression model by replacing pi with pi' (the estimated pi)? log (pi'/(1-pi')) = beta_0 + beta_1*X_1 + .....+ ei Thanks! [[alternative HTML version deleted]]
2007 Sep 13
1
Problem using xtable on an array
Hi all I know about producing a minimal example to show my problem. But I'm having trouble producing a minimal example that displays this behaviour, so please bear with me to begin with. Observe: I create an array called model.mat. Some details on this: > str(model.mat) num [1:18, 1:4] -0.170 -0.304 -2.617 2.025 -1.610 ... - attr(*, "dimnames")=List of 2 ..$ : chr
2004 Aug 23
1
Two factor ANOVA with lm()
The following is a data frame > "jjd" <- structure(list(Observations = c(6.8, 6.6, 5.3, 6.1, 7.5, 7.4, 7.2, 6.5, 7.8, 9.1, 8.8, 9.1), LevelA = structure(c(1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3), .Label = c("A1", "A2", "A3"), class = "factor"), LevelB = structure(c(1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2), .Label =
2003 Feb 08
3
to modify a matrix
Hi All. I am quite a newbie to R. This is a next basic question. I have a matrix; > x <- matrix(1:10.,5) > x [,1] [,2] [1,] 1 6 [2,] 2 7 [3,] 3 8 [4,] 4 9 [5,] 5 10 I like to get a modified matrix as follows; [,1] [,2] [1,] 1 6 [2,] 2 7 [3,] 3 8 * 5 -> 40 [4,] 4 9 [5,] 5 10 The following expression does not work.
2008 May 16
1
SE of difference in fitted probabilities from logistic model.
I am fitting a logistic binomial model of the form glm(y ~ a*x,family=binomial) where a is a factor (with 5 levels) and x is a continuous predictor. To assess how much ``impact'' x has, I want to compare the fitted success probability when x = its maximum value with the fitted probability when x = its mean value. (The mean and the max are to be taken by level of the factor
2013 Jan 08
4
Logical operator and lists
Hello R-Helpers, I have a slight problem with the expresion data[data==""] <- NA which works well for a data.frame. But now i must use the same for a list of data.frames. My idea is data[[]][data==""] but it donĀ“t work. Thanks!! Dominic [[alternative HTML version deleted]]