similar to: starting values in glm(..., family = binomial(link =log))

Displaying 20 results from an estimated 3000 matches similar to: "starting values in glm(..., family = binomial(link =log))"

2013 Jan 29
1
starting values in glm(..., family = binomial(link = log))
Dear R-helpers, i have a problem with a glm-model. I am trying to fit models with the log as link function instead of the logit. However, in some cases glm fails to estimate those models and suggests to give start values. However, when I set start = coef(logistic_model) within the function call, glm still says it cannot find starting values? This seems to be more of a problem, when I include a
2013 Mar 19
1
fisher.alpha warnings
I have two vectors (a and b) with counts of animals and wanted to calculate fisher's alpha: library(vegan) a <- c(2043, 1258, 52, 1867, 107, 1624, 2, 157, 210, 402, 5, 107, 267, 2, 13683) b <- c(2043, 1258, 52, 1867, 107, 1624, 2, 157, 210, 402, 5, 107, 267, 2, 3000) fisher.alpha(a) fisher.alpha(b) fisher.alpha(a) gave the following warnings: > fisher.alpha(a) [1] 1.572964
2009 Dec 10
2
Problem with coeftest using Newey West estimator
Hi, I want to calculate the t- and p-values for a linear model using the Newey West estimator. I tried this Code and it usually worked just fine: > oberlm <- lm(DYH ~ BIP + Infl + EOil, data=HU_H) > coeftest(oberlm, NeweyWest(oberlm, lag=2)) t test of coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.1509950 0.0743832 2.0300 0.179486 BIP
2008 Oct 22
1
R 2.8.0 qqnorm produces error with object of class zoo?
Dear list-reader, by running the following script: library(zoo) sessionInfo() search() packageDescription("zoo") data(EuStockMarkets) dax <- as.zoo(EuStockMarkets[1:10, "DAX"]) daxr <- diff(log(dax)) identical(as.vector(qnorm(daxr)), qnorm(coredata(daxr))) qqnorm(coredata(daxr)) qqnorm(daxr) qqnorm() produces an error: > qqnorm(daxr) Fehler in if (xi == xj) 0L
2012 Apr 03
1
A contour plot question - vis.gam () function in "mgcv"
Hi, Please see the attached contour plot (I am sorry about the big file). This was created using the vis.gam() function in "mgcv" package. However, my question is somewhat broader. In generating this figure, I first created the contours using vis.gam() and then I plotted the points. These point are plotted on top of the contours so that some of the contour lines are only partially
2011 Aug 31
1
Gradients in optimx
Hi Reuben, I am puzzled to note that the gradient check in "optimx" does not work for you. Can you send me a reproducible example so that I can figure this out? John - I think the best solution for now is to issue a "warning" rather than an error message, when the numerical gradient is not sufficiently close to the user-specified gradient. Best, Ravi.
2011 Sep 28
1
Download statistics for a package
Hi, How can I get information on how many times a particular package has been downloaded from CRAN? Thanks, Ravi. ------------------------------------------------------- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvaradhan@jhmi.edu<mailto:rvaradhan@jhmi.edu> [[alternative
2012 Apr 19
4
Column(row)wise minimum and maximum
Hi, Currently, the "base" has colSums, colMeans. It seems that it would be useful to extend this to also include colMin, colMax (of course, rowMin and rowMax, as well) in order to facilitate faster computations for large vectors (compared to using apply). Has this been considered before? Please forgive me if this has already been discussed before. Thanks, Ravi Ravi Varadhan, Ph.D.
2004 Dec 03
3
Computing the minimal polynomial or, at least, its degree
Hi, I would like to know whether there exist algorithms to compute the coefficients or, at least, the degree of the minimal polynomial of a square matrix A (over the field of complex numbers)? I don't know whether this would require symbolic computation. If not, has any of the algorithms been implemented in R? Thanks very much, Ravi. P.S. Just for the sake of completeness, a
2005 Apr 20
3
Keeping factors with zero occurrences in "table" output
Dear R group, I have a data frame which contains data on preferences on 7 items (ranks 1 through 7) listed by each participant. I would like to tabulate this in a 7x7 table where the rows would be the items and the columns would be the number of times that item received a particular rank. I tried doing this by creating a matrix by "rbind"ing each vector obtained using
2011 Aug 26
2
How to generate a random variate that is correlated with a given right-censored random variate?
Hi, I have a right-censored (positive) random variable (e.g. failure times subject to right censoring) that is observed for N subjects: Y_i, I = 1, 2, ..., N. Note that Y_i = min(T_i, C_i), where T_i is the true failure time and C_i is the censored time. Let us assume that C_i is independent of T_i. Now, I would like to generate another random variable U_i, I = 1, 2, ..., N, which is
2011 Jun 24
4
How to capture console output in a numeric format
Hi, I would like to know how to capture the console output from running an algorithm for further analysis. I can capture this using capture.output() but that yields a character vector. I would like to extract the actual numeric values. Here is an example of what I am trying to do. fr <- function(x) { ## Rosenbrock Banana function on.exit(print(f)) x1 <- x[1] x2 <- x[2]
2005 Nov 21
4
Can't figure out warning message
Hi, I apologize for the previous posting, where the message was not formatted properly. Here is a better version: I have written the following function to check whether a vector has elements satisfying monotonicity. is.monotone <- function(vec, increase=T){ ans <- TRUE vec.nomis <- vec[!is.na(vec)] if (increase & any(diff(vec.nomis,1) < 0, na.rm=T)) ans <- FALSE
2008 Jan 23
1
Problem with estimation of distribution parameters
Hi, I tried to calculate the MLE estimation of a parameter of a gamma distribution of a data set, which is called "amount".. I did it with the command: fitdistr(amount,"gamma") and got the error message: Error in optim(x = c(363.36, 551.15, 603.91, 170.99, 225.21, 218.01, 1816.82, : non-finite finite-difference value [2] Warning message: NaNs wurden erzeugt
2013 Apr 25
2
Vectorized code for generating the Kac (Clement) matrix
Hi, I am generating large Kac matrices (also known as Clement matrix). This a tridiagonal matrix. I was wondering whether there is a vectorized solution that avoids the `for' loops to the following code: n <- 1000 Kacmat <- matrix(0, n+1, n+1) for (i in 1:n) Kacmat[i, i+1] <- n - i + 1 for (i in 2:(n+1)) Kacmat[i, i-1] <- i-1 The above code is fast, but I am curious about
2009 Mar 02
1
Problem with dummy variables controlling for years
Hello everybody, I'm running a panel regression with dummy variables controlling for years. While this works fine for most of my models, in some cases I get the error message "In sqrt(diag(object$vcov)) : NaNs wurden erzeugt" and missing results for some or all of my year dummies: Estimate Std. Error z-value Pr(>|z|) year2000
2011 Dec 29
0
problem of "constrOptim.nl", no hessian and convergence
Hi, Use the `auglag' function in "alabama" if you want to get the Hessian at convergence. This typically tends to perform better than `constrOptim.nl'. Also, `constrOptim.nl' does not compute the Hessian. You should not specify method="L-BFGS-B". The default method "BFGS" is better in this setting. Hope this helps, Ravi
2006 Sep 18
0
Propensity score modeling using machine learning methods. WAS: RE: LARS for generalized linear models
There may be benefits to having a machine learning method that explicitly targets covariate balance. We have experimented with optimizing the weights directly to obtain the best covariate balance, but got some strange solutions for simple cases that made us wary of such methods. Machine learning methods that yield calibrated probability estimates should do well (e.g. those that optimize the
2006 Nov 14
2
Matrix-vector multiplication without loops
Hi, I am trying to do the following computation: p <- rep(0, n) coef <- runif(K+1) U <- matrix(runif(n*(2*K+1)), n, 2*K+1) for (i in 0:K){ for (j in 0:K){ p <- p + coef[i+1]* coef[j+1] * U[,i+j+1] } } I would appreciate any suggestions on how to perform this computation efficiently without the "for" loops? Thank
2006 Sep 29
2
X-axis labels in histograms drawn by the "truehist" function
Hi, I have a simple problem that I would appreciate getting some tips. I am using the "truehist" function within an "apply" call to plot multiple histograms. I can't figure out how to get truehist to use the column names of the matrix as the labels for the x-axis of the histograms. Here is a simple example: X <- matrix(runif(4000),ncol=4) colnames(X)