Displaying 20 results from an estimated 20000 matches similar to: "Source Code glm() question"
2017 Sep 21
0
Add wrapper to Shiny in R package
Dear Axel,
I've used environment for such problems.
assign("xs", xs, envir = my.env) in the myApp function
get("xs", envir = my.env) in the server function
Best regards,
ir. Thierry Onkelinx
Statisticus/ Statiscian
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
AND FOREST
Team Biometrie &
2017 Sep 21
1
Add wrapper to Shiny in R package
Thank you Thierry. I'm trying to following your suggestion in the example
below, but getting:
Error in get("xs", envir = my.env) : object 'my.env' not found.
library(shiny)
library(shinydashboard)
myApp <- function(x, ...) {
xs <- scale(x)
my.env <- new.env()
assign("xs", xs, envir = my.env)
shiny::runApp(app)
}
app = shinyApp(
ui =
2017 Sep 21
3
Add wrapper to Shiny in R package
Dear List,
I'm trying to add a function that calls a Shiny App in my R package. The
issue is that within my function, I'm creating objects that I'd like to
pass to the app. For instance, from the example below, I'm getting
"Error: object
'xs' not found". How can I pass "xs" explicitly to shinyApp()?
*Under R directory:*
myApp <- function(x, ...) {
2010 Jul 22
1
GLM Starting Values
Hello,
Suppose one is interested in fitting a GLM with a log link to binomial data. How does R choose starting values for the estimation procedure? Assuming I don't supply them.
Thanks,
Tyler
2017 Sep 17
2
Shiny App inside R Package
Dear List,
I have a wrapper function that creates a Shiny App, as illustrated below.
I'd like to include the function myApp() inside a package. I'd appreciate
your guidance here, as I could not find good instructions on this online.
myApp <- function(x) {
require(shiny)
shinyApp(
ui = fluidPage(
sidebarLayout(
sidebarPanel(sliderInput("n",
2009 Dec 17
2
segfault in glm.fit (PR#14154)
Bug summary:
glm() causes a segfault if the argument 'data'
is a data frame with more than 16384 rows.
Bug demonstration:
-------input ---------------
N <- 16400
df <- data.frame(x=runif(N, min=1,max=2),y=rpois(N, 2))
glm(y ~ x, family=poisson, data=df)
------ output ---------------
*** caught segfault ***
address (nil),
2003 Jan 21
1
Starting values for glm fits
I'm fitting some small data sets using a binomial glm with complementary
log-log link. In some ill-conditioned cases I am getting convergence
failures. I know how to adjust maxit and epsilon, but that doesn't seem
to help.
In fact I know some very good starting values for my fits, but I can't
see how to get them in to glm(). How may I do this?
--
Dr Murray Jorgensen
2002 Feb 27
1
Bug in glm.fit? (PR#1331)
G'day all,
I had a look at the GLM code of R (1.4.1) and I believe that there are
problems with the function "glm.fit" that may bite in rare
circumstances. Note, I have no data set with which I ran into
trouble. This report is solely based on having a look at the code.
Below I append a listing of the glm.fit function as produced by my
system. I have added line numbers so that I
2010 Apr 16
2
Weights in binomial glm
I have some questions about the use of weights in binomial glm as I am
not getting the results I would expect. In my case the weights I have
can be seen as 'replicate weights'; one respondent i in my dataset
corresponds to w[i] persons in the population. From the documentation
of the glm method, I understand that the weights can indeed be used
for this: "For a binomial GLM prior
2009 Mar 27
1
deleting/removing previous warning message in loop
Hello R Users,
I am having difficulty deleting the last warning message in a loop so that the only warning that is produced is that from the most recent line of code. I have tried options(warn=1), rm(last.warning), and resetting the last.warning using something like:
> warning("Resetting warning message")
This problem has been addressed in a previous listserve string,
2006 Nov 12
2
segfault 'memory not mapped', dual core problem?
I encountered a segfault running glm() and wonder if it could have
something to do with the way memory is handled in a dual core system
(which I just set up). I'm running R-base-2.4.0-1, installed from the
SuSE 10.1 x86_64 rpm (obtained from CRAN). (My processor is an AMD
Athlon 64 x2 4800+).
The error and traceback are
*** caught segfault ***
address 0x8001326f2b, cause 'memory not
2006 Apr 11
1
gaussian family change suggestion
Hi,
Currently the `gaussian' family's initialization code signals an error if
any response data are zero or negative and a log link is used. Given that
zero or negative response data are perfectly legitimate under the GLM
fitted using `gaussian("log")', this seems a bit unsatisfactory. Might
it be worth changing it?
The current offending code from `gaussian' is:
2011 Jan 25
1
Predictions with 'missing' variables
Dear List,
I think I'm going crazy here...can anyone explain why do I get the same
predictions in train and test data sets below when the second has a missing
input?
y <- rnorm(1000)
x1 <- rnorm(1000)
x2 <- rnorm(1000)
train <- data.frame(y,x1,x2)
test <- data.frame(x1)
myfit <- glm(y ~ x1 + x2, data=train)
summary(myfit)
all(predict(myfit, test) == predict(myfit, train))
2005 Oct 14
2
subset selection for glm
Hello:
Are there any libraries that will do a subset selection for glm's? I looked
through leaps, but seems like it is specifically for linear regressions.
Thank you.
-Dhiren
2018 Feb 26
2
glm package - Negative binomial regression model - Error
HI there
I am running this model in negative binomial regression, using glm.
I had no problems with running the model with a set of data, but now that
i'm trying to run if for new one. I always have this same error when
running the regression:
>
> #Run Regression
> x=cbind(factor2ind(d$year),factor2ind(d$month_week))
>
> out<- glm(cbind(influenza, n_sample) ~ x,
2009 Sep 19
1
Poisson Regression - Query
Hi All,
My dependent variable is a ratio that takes a value of 0 (zero) for 95% of
the observations and positive non-integer values for the other 5%. What
model would be appropriate? I'm thinking of fitting a GLM with a Poisson ~.
Now, becuase it takes non-integer values, using the glm function with
Poisson family issues warning messages.
Warning messages:
1: In dpois(y, mu, log = TRUE) :
2008 Oct 19
1
MCMClogit: using weights
Hi everyone: I am just wondering how can I use weights with MCMClogit function (in MCMCpack package). For example, in case of glm function as given below, there is weights option in the arguments. Aparently there is no option of using weights in MCMClogit.
glm(formula, family = gaussian, data, weights, subset,
na.action, start = NULL, etastart, mustart,
offset, control =
2006 Jun 30
2
Passing arguments to glm()
Hi there
I want to pass arguments (i.e. the response variable and the subset
argument) in a self-made function to glm.
Here is one way I can do this:
f.myglm <- function(y,subfact,subval) {
glm(d.mydata[,y]~d.mydata[,'x1'],family=binomial,subset=d.mydata[,subfact]==subval)
}
> str(d.mydata)
`data.frame': 15806 obs. of 3 variables:
$ y : Factor w/ 2 levels
2018 Feb 26
0
glm package - Negative binomial regression model - Error
Dear Paula,
There are probably missing observations in your data set. Read the
na.action part of the glm help file. na.exclude is most likely what you are
looking for.
Best regards,
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg /
2016 Apr 01
3
TensorFlow in R
Hi All,
I didn't have much success through my Google search in finding any active
R-related projects to create a wrapper around TensorFlow in R. Anyone know
if this is on the go?
Thanks,
Axel.
[[alternative HTML version deleted]]