Displaying 20 results from an estimated 6000 matches similar to: "Subset and plot"
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
2010 Feb 10
2
simple subtraction in a single vector
OK, this is very elementary, but I need help. I have looked in Verzani,
past postings etc.
Problem: I need to subtract the "length" date between "h4" and "a3" #which
would be 4-1
I would rather not convert the two columns into four columns (with headings
being "a3","a4","c4","h4").
DF <- data.frame(length=c(1,2,3,4),
2010 Jan 09
1
Boxplots
I have a data set with four columns and need to make boxplots from them.
Data is as follows:
tank Tanks Total cons_hat
1 a a4 5.651017 5.59
2 a a5 5.017499 5.29
3 a a6 4.894238 4.69
4 c c4 3.986347 3.40
5 c c5 4.099442 3.58
6 c c6 4.150522 3.64
7 h h4 5.187792 6.32
8 h h5 6.713422 6.44
9 h h6 5.168555
2010 Jan 11
1
Point plot comparisions
I would like to create a point plot with the following two sets of points:
#1 plot(Day,Total) and #2 (Day,cons_hat). Total is the actual value seen
and cons-hat is a predicted value. If possible, I do not want to stack them
as they are quite long. (FYI, I did use the reshape on a previous post,
thanks, but this one is different).
Day Tank Tanks Total cons_hat
1 a a4 5.651017 5.59
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 <-
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)
2006 Apr 19
1
Trouble with glm() .... non-integer #successes in a binomial glm
Hi R-people:
When I use the command to fit a model with an intercept, only:
glm ( formula=haspdata ~ 1, data=dat, family=binomial, weights=
dat$hy.wgt.s, subset=(dat$haspdat0!=3) )
I get the message:
Warning message:
non-integer #successes in a binomial glm! in: eval(expr, envir, enclos)
Does anyone know what this means?? The data for this command is listed
below.
Thanks,
Phil Smith
CDC
2019 Feb 04
1
doveadm import with subfolder oddity
This has got to be something weird in my config. And the standard
disclaimer of '"happy to post doveconf -n, but wanted to see if this is
normal first" :)
Background: Ubuntu Xenial, running 2.2.36. Mailbox type is mdbox and I've
got a period separator in my inbox namespace:
namespace {
hidden = no
inbox = yes
list = yes
location =
mailbox Spam {
auto = no
2013 Nov 16
16
[PATCH] BTRFS-PROG: recursively subvolume snapshot and delete
Hi All,
the following patches implement the recursively snapshotting and
deleting of a subvolume.
To snapshot recursively you must pass the -R switch:
# btrfs subvolume create sub1
Create subvolume ''./sub1''
# btrfs subvolume create sub1/sub2
Create subvolume ''sub1/sub2''
# btrfs subvolume snapshot -R sub1 sub1-snap
Create a snapshot of
2013 Aug 05
2
Fileoperations in Maildir – problematic or okay?
Hi,
I'm wondering: Is it a problem to move and delete files inside a dovecot-managed maildir?
For example:
I have a folder ~/.maildir/.Sub1.Start/cur and a folder ~/.maildir/.Sub1.Start.old/cur
and like to regularly move old mails from the first to the second one.
Can you create a cron job saying something like:
find ~/.maildir/.Sub1.Start/cur -mtime +5 -exec mv {}
2020 Nov 19
1
Problems with undef subranges in identity copies
Hi,
I'm stuck trying to fix a variety of problems that occur with undef
subregisters when the register coalescer eliminates identity
copies. The fundamental problem is complexity from the fact that undef
values are a special case since they don't have an associated
VNInfo/Segment unless the value is used across blocks.
For example, in this case, %0 has 2 subregisters sub0 and sub1:
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 Oct 02
3
outlook idiocy - IMAP folders with /
On 2018-10-01 04:07, Timo Sirainen wrote:
>
> https://wiki2.dovecot.org/Plugins/Listescape?maybe?
It should be mentioned somehow that one can't just change the hierarchy
separator on the fly (without manual changes to the fs).
If you used . as the separator, it would look this in the filesystem:
.testfolder.sub1
Now you change the separator to $.
Your mail client will see the existing
2017 May 16
2
Bug in TableGen RegisterBankEmitter
On 05/16/2017 11:57 AM, Daniel Sanders wrote:
>> If that's right, one possible fix would be to rename some of the subregister indices but that's likely to be quite painful. I'll have a think and see if I can come up with something nicer.
>
> I haven't been able to come up with a better answer for this, just an alternate choice as to where the complexity is. If we were
2006 Mar 23
1
comparative density estimates
I have two series of events over time and I want to construct a graph of the
relative frequency/density of these events that allows their
distributions to
be sensibly compared. The events are the milestones items in my project on
milestones in the history of data visualization [1], and I want to
compare trends
in Europe vs. North America.
I decided to use a graph of two overlaid density