cardiomoon / autoreg Goto Github PK
View Code? Open in Web Editor NEWR package autoReg
Home Page: https://cardiomoon.github.io/autoReg/
R package autoReg
Home Page: https://cardiomoon.github.io/autoReg/
Hi,
the autoReg function throws an error when the model is of the form:
glm(y ~ x1 + x2, weights = w, data=data, family='binomial')
The error being:
Error in map():
โน In index: 1.
Caused by error in model.frame.default():
! 'data' must be a data.frame, environment, or list
Run rlang::last_trace() to see where the error occurred.
After digging deeper, the issue seems to stem from the function: fit2model, about line 77
dataname = as.character(fit$call)[length(as.character(fit$call))]
What happens is that, if you incorporate sample weights into the model, it appears as the last object in fit$call, and therefore dataname gets a vector of weights instead of the dataset used in fitting the model.
Another the issue seems to be coming from fit2list, as it fits a lm/glm model in about line 18, 21-22, with only, formula, data and family being parameters, there should probably be a ...
so that extra parameters e.g weights are incorporated.
Thank you for the package. Packages creating publication ready tables are always welcome. I found that, at least for plain linear models, specifying new contrasts does not produce the final table as I expected. See the following for an example of what happens:
`library(autoReg)
data("mtcars")
fit=lm(mpg ~ cyl,
data=mtcars)
autoReg(fit,final=TRUE)
mtcars$cyl.f <- factor(mtcars$cyl)
fit = lm(mpg ~ cyl.f,
data=mtcars)
autoReg(fit,final=TRUE)
contrasts(mtcars$cyl.f) <- contr.treatment(3, base = 3)
fit = lm(mpg ~ cyl.f,
data=mtcars)
autoReg(fit,final=TRUE)`
Admittedly, I do not know how to read R code well enough to look at the underlying functions to know what is going on, or how it might be fixed.
Thanks again.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.