Questions tagged [vgam]
33 questions
12
votes
1 answer
R: Incompatible Dimensions Error vglm function in VGAM
TL;DR
I am running Tobit regressions with the VGAM package in R -- Here is a toy dataset that is consistently giving me an error that I have not been able to diagnose:
library(data.table)
library(VGAM)
> sessionInfo()$otherPkgs
$VGAM
Package:…

mlegge
- 6,763
- 3
- 40
- 67
5
votes
1 answer
How to use robust se and cluster se with vglm tobit model?
I'm trying to migrate a tobit model from Stata to R.
The Stata commands for robust would be to just add ,vce(robust) to the model. And for clustering it would be ,vce(cluster idvar).
Reproducible Stata example:
use…

Jake Russ
- 683
- 1
- 9
- 19
3
votes
0 answers
Plotting VGLM multinomial logistic regression with 95% CIs
I would like to plot the predicted values of a multinomial logistic regression derived from the vglm() function in the VGAM package.
It is important that I use VGAM because I am trying to replicate a colleague's analysis conducted in Stata, which I…

Calen
- 305
- 4
- 17
3
votes
1 answer
Latex or HTML summary output table for vglm regression objects (VGAM)
I'm trying to get a latex or html output of the regression results of a VGAM model (in the example bellow it's a generalized ordinal logit). But the packages I know for this purpose do not work with a vglm object.
Here you can see a little toy…

RogerioJB
- 355
- 1
- 8
2
votes
1 answer
multinomial/conditional logit with grouped data in R
I'm looking for a way to fit a conditional logit on grouped data in R. I have multinomial choice counts with response- and individual-specific variables. Unfortunately, the expanded dataset would be too huge to work with it. Thus I can't use most of…

Cabana
- 419
- 2
- 7
1
vote
1 answer
No longer can use vglm for underdispersed count data in R?
I've read elsewhere that the VGAM package can be used to model underdispersed count data via the genpoisson families. However, when I look up the help file for genpoisson0, genpoisson1, and genpoisson2 they all say the following:
"In theory the λ…

Bryan
- 225
- 1
- 11
1
vote
0 answers
Comparing results of svy_vglm regression models ('survey','svy_VGAM','mitools','mice' in R)
I'm running regression models on multiple imputations of complex survey data set with the R packages 'survey', 'svy_VGAM' and 'mitools'. I use svy_VGAM::svy_vglm() on a svyimputationList (created in 'mitools'), then combine the results with…

rmwonder
- 13
- 3
1
vote
1 answer
Fitting zero-truncated negative binomial to some datasets with VGLM fails
I've been trying to fit a zero truncated negative binomial to some count data. In some cases it works beautifully, for example:
library(ggplot2)
library(VGAM)
df <- data.frame(n = 1:7, freq = c(0.32, 0.286, 0.19, 0.10, 0.05, 0.02, 0.01))
fit =…

OGW
- 11
- 2
1
vote
0 answers
Need help installing VGAM package for R 3.3.3
Unable to make three previously described ways to manually install an old package (VGAM) for an old version of R (v3.3.3) to work on Platform: x86_64-apple-darwin13.4.0 (64-bit)
Previous threads on this subject that I have attempted to draw…

benny_noJets
- 11
- 2
1
vote
1 answer
Maximum likelihood estimation of beta-normal in R
i want to estimate the parameters of beta-normal distribution.I've used the maxLik package
library(VGAM)
library(maxLik)
alfa=2;beta=3;mu=0;sigma=1
n=100
x=rbetanorm(n,alfa,beta,mu,sigma)
logLikFun=function(w){
alfa=w[1]
beta=w[2]
mu=w[3]
…

saly
- 11
- 3
1
vote
2 answers
Error adding interactions to custom VGAM::vglm model in caret
I've built a custom model with caret using vglm() from VGAM. It works fine with simple effects but when I try to add interactions it fails with a object 'x1:x2' not found error message, where x1 and x2 are predictor variables that I've entered into…

Johan Larsson
- 3,496
- 18
- 34
1
vote
0 answers
gamma2 link function choice VGAM package of R
I'm using the VGAM package in R with the gamma2 family function (two parameters: mu and shape).
I'm hesitating in the choice of the link function. In fact, I have the two following fits:
fit1 <- vglm(y ~ x,
family = gamma2(lmu…

Hocus68
- 13
- 4
1
vote
1 answer
VGAM percentile curve plot in R
I am running following code from help files of VGAM:
library(VGAM)
fit4 <- vgam(BMI ~ s(age, df = c(4, 2)), lms.bcn(zero = 1), data = bmi.nz, trace = TRUE)
qtplot(fit4, percentiles = c(5,50,90,99), main = "Quantiles", las = 1, xlim = c(15, 90),…

rnso
- 23,686
- 25
- 112
- 234
1
vote
1 answer
Percentiles from VGAM
I am using following example from help pages of package VGAM
library(VGAM)
fit4 <- vgam(BMI ~ s(age, df = c(4, 2)), lms.bcn(zero = 1), data = bmi.nz, trace = TRUE)
qtplot(fit4, percentiles = c(5,50,90,99), main = "Quantiles", las = 1, xlim = c(15,…

rnso
- 23,686
- 25
- 112
- 234
1
vote
1 answer
How can I get logLik or AIC of a vglm fit
I couldn't get them via normal methods.
> x <- rnorm(1000, 10, 1)
> y <-rgamma(1000, shape=1, rate=x)
> myfit <- vglm(y~x, family=gammaff(link="reciprocal"))
> summary(myfit)
Call:
vglm(formula = y ~ x, family = gammaff(link =…

colinfang
- 20,909
- 19
- 90
- 173