Displaying 20 results from an estimated 200 matches similar to: "Trouble with glm() .... non-integer #successes in a binomial glm"
2006 Jan 17
1
Step.glm() question
Hi:
I am using step.glm() as follows:
form1 <- as.formula(haspdata ~ 1)
lg.mod1 <- glm ( formula=form1, data=st.mtx,
family=binomial , na.action=na.omit )
upper <- as.formula( haspdata ~ (
c5+childnm+educ1+incpov1+marital+msa+racekid+racemom+sex+shotcard )^2)
lower <- as.formula(haspdata~1)
lst <- list( upper=upper , lower=lower )
form1a.step <- step(lg.mod1, scope=lst
2018 May 03
4
adding overall constraint in optim()
Hi ?
This is giving me a headache. I?m trying to do a relatively simple optimization ? actually trying to approximate the output from the Excel Solver function but at roughly 1000x the speed. ?
The optimization parameters look like this. The only trouble is that I want to add a constraint that sum(wgt.vect)=1, and I can?t figure out how to do that in optim.
Mo.vect <-
2010 Feb 02
2
Subset and plot
Here is a runable program. When I plot Day and Wgt, it graphs all the data
points. All I need is daily.sub1 plotted. I also need each "Tanks" to have
its own col or pch. When I run it with the line with pch, it gives me
nothing.
rm(list=ls())
Trial<-rep(c(1,2),each=12)
Tanks=rep(c("a3","a4","c4","h4"),each=3,2)
Day=rep(c(1:12),2)
2018 May 06
1
adding overall constraint in optim()
Hi Michael,
A few comments
1. To add the constraint sum(wgt.vect=1) you would use the method of
Lagrange multipliers.
What this means is that in addition to the w_i (the components of the
weight variables) you would add an additional variable, call it lambda.
Then you would modify your optim.fun() function to add the term
lambda * (sum(wgt.vect - 1)
2. Are you sure that you have defined
2018 May 03
0
adding overall constraint in optim()
You can't -- at least as I read the docs for ?optim (but I'm pretty
ignorant about this, so maybe there's a way to tweak it so you can).
See here: https://cran.r-project.org/web/views/Optimization.html
for other R optimization capabilities.
Also, given your credentials, the r-sig-finance list might be a
better place for you to post your query.
Cheers,
Bert
Bert Gunter
2004 Sep 21
2
Ever see a stata import problem like this?
Greetings Everybody:
I generated a 1.2MB dta file based on the general social survey with
Stata8 for linux. The file can be re-opened with Stata, but when I bring
it into R, it says all the values are missing for most of the variables.
This dataset is called "morgen.dta" and I dropped a copy online in case
you are interested
http://www.ku.edu/~pauljohn/R/morgen.dta
looks like this
2018 May 03
2
adding overall constraint in optim()
Thanks Bert. But everyone on that forum wants to use finance tools rather than general optimization stuff! And I am not optimizing a traditional Markowitz mean-variance problem. Plus, smarter people here. :-)
> On May 3, 2018, at 3:01 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
>
> You can't -- at least as I read the docs for ?optim (but I'm pretty
> ignorant
2018 May 04
0
adding overall constraint in optim()
On Thu, May 3, 2018 at 2:03 PM, Michael Ashton
<m.ashton at enduringinvestments.com> wrote:
> Thanks Bert. But everyone on that forum wants to use finance tools rather than general optimization stuff! And I am not optimizing a traditional Markowitz mean-variance problem. Plus, smarter people here. :-)
>
I'm very confused by these statements. Most of the "finance tools"
2009 May 31
1
Bug in gmodels CrossTable()?
Is the code below showing a bug in Crosstable()? My expectation was that
the values produced by xtabs were rounded instead of truncated:
library(gmodels)
abc <- c("a", "a", "b", "b", "c", "c")
def <- c("d", "e", "f", "f", "d", "e")
wgt <- c(0.8, 0.6, 0.4, 0.5, 1.4, 1.3)
2010 Feb 02
1
Subset and point plot
OK, I need help plotting. I have column headings of Day, Wgt, Foodin, Rep,
Grp and Tanks. Rep=c(1,2,3) and Tanks=c(a1,a2,a3,a4,a5,a6,
c1,c2,c3,c4,c5,c6, h1,h2,h3,h4,h5,h6).
I created a subset where I only would like Rep=2, and Tanks=c(a4,c4,h4) and
would like to graph (points) of Wgt and Day. I would think that I only need
3 colors, but when I run with only 3, only 2 lines show up. When I add
2009 Nov 14
4
Weighted descriptives by levels of another variables
I've noticed that R has a number of very useful functions for
obtaining descriptive statistics on groups of variables, including
summary {stats}, describe {Hmisc}, and describe {psych}, but none that
I have found is able to provided weighted descriptives of subsets of a
data set (ex. descriptives for both males and females for age, where
accurate results require use of sampling
2018 May 05
1
adding overall constraint in optim()
Hi,
You can use the projectLinear argument in BB::spg to optimize with linear equality/inequality constraints.
Here is how you implement the constraint that all parameters sum to 1.
require(BB)
spg(par=p0, fn=myFn, project="projectLinear", projectArgs=list(A=matrix(1, 1, length(p0)), b=1, meq=1))
Hope this is helpful,
Ravi
[[alternative HTML version deleted]]
2008 Feb 29
1
barplot and pca plot in mvpart/rpart
Hello,
I'm using the R package called mvpart, which is about the multivariate
regression trees.
The function I wrote is:
mrt1<- mvpart(coefmat~sChip+sScreen+sMem,data=mixdata, xv="pick",
plot.add=TRUE,uniform=TRUE,which=4,all=TRUE,xadj=2,yadj=2,rsq=TRUE,big.pts=TRUE,wgt.ave.pca=TRUE,legend=TRUE,bars=F,
pca=TRUE)
where "coefmat" is a matrix(of dimension N*K) to store
1999 Apr 28
2
smbmount doesn't work
Hi,
Thanks for answering my question on the new smbmount not working. I tried
all variety of combinations on the commands you suggested, but they all
simply do this:
% smbmount -c //server/share 'mount /mnt/samba-share -n CLIENT -U user'
Usage: smbmount service <password> [-p port] [-d debuglevel] [-l log]
Version 2.0.3
-p port connect to the specified port
2003 May 31
0
logistic regression
hi all,
I am fitting a logistic regression model on binary data. I care about
the fitted probabilities, so I am not worried about infinite
(or non-existent) MLEs. I use:
> glm(Y~., data=X, weights=wgt, family=binomial(link=logit), maxit=250)
I understand the three ways to fit model, and in my case Y is a factor,
one column
> Y <- c(rep("A",679), rep("B",38))
2003 May 31
0
logistic regression (weights)
hi all,
I am fitting a logistic regression model on binary data. I care about
the fitted probabilities, so I am not worried about infinite
(or non-existent) MLEs. I use:
> glm(Y~., data=X, weights=wgt, family=binomial(link=logit), maxit=250)
I understand the three ways to fit model, and in my case Y is a factor,
one column
> Y <- c(rep("A",679), rep("B",38))
2010 Sep 27
3
Alphabetical sequence of data along the x-axis in a box plot
Hello All,
I noticed when I generated some boxplots, the data is presented in
alphabetical order along the x-axis (the data in this case was the four
quandrants of a sample area (NE,NW, SE, SW) that was my first column of
data). Is there a way to have R plot the data in a different order? I
imagine you could use a dummy variable, but didn't know if there might
be a simple argument that
2007 Oct 10
0
Warning message when using "reldist" package
Dear R users,
I'm using the "reldist" add-on package to calculate relative distribution in R as part of my research project. The subject is a general mental health score ranging from 0 to 12 (integer values only) with 0 indicating no mental health problem and positive values meaning some or sever mental health problem.
When I run the programme to compare the scores of population
1998 Jun 19
16
WARNING: Break-in attempts
Greetings all,
I''m forwarding a copy of an email I sent reporting attempted
break-ins on my main server, earth.terran.org. I am forwarding this
because I think it is relevant that folks watch for this kind of activity
in their logs to catch people who "try doorknobs" in the middle of the
night. After sending this email, I sent a talk request to the user, who
was still logged
1998 Jul 14
3
Qpop CERT advisory?
Hello,
Anyone have information on whether RedHat-5.0+ is affected by the
recent (today's) CERT advisory regarding QPOP?
thanks,
-bp
--
B. James Phillippe <bryan@terran.org>
Linux Software Engineer, WGT Inc.
http://earth.terran.org/~bryan