:31 a.m.
To: r-help@stat.math.ethz.ch
Subject: [R] simple coding question
I have a list of ICD9 (disease) codes with various formats - 3 digit,
4 digit, 5 digit. The first three digits of these codes are
what I am most interested in. I would like to either add
zeros to the 3 and 4
I have a list of ICD9 (disease) codes with various formats - 3 digit,
4 digit, 5 digit. The first three digits of these codes are what I am
most interested in. I would like to either add zeros to the 3 and 4
digit codes to make them 5 digit codes or add decimal points to put
them all in the
: Tuesday, 31 July 2007 9:31 a.m.
To: r-help@stat.math.ethz.ch
Subject: [R] simple coding question
I have a list of ICD9 (disease) codes with various formats - 3 digit,
4 digit, 5 digit. The first three digits of these codes are
what I am most interested in. I would like to either add
zeros
I agree entirely with Gabor. My advice would be to just ignore the people who
think differently -- however, if you want those particular folks to respond,
you'll have to play by their rules. (and if you don't play by their rules,
you'll just have to ignore the consequences -- this _IS_ the
On 4/28/2007 6:20 AM, AJ Rossini wrote:
I agree entirely with Gabor. My advice would be to just ignore the people
who
think differently
That's fairly bad advice, in that many of the people who actually
provide helpful advice are old-fashioned, and like to know who they're
providing it
Is this an ad hominem comment or a comment of brevity? Unless my eyes
are playing tricks on me, I can't seem to find any language in the
Posting Guide on what is considered a reasonable vs. unreasonable
request from an anonymous poster. Kindly point me to it if it exists.
In any case, thanks
I don't think there is any requirement to identify yourself in any
way nor should their be. Many people on the list are in academia
and in those cases they probably want their name in lights but
others may wish to have a lower profile and its common to use
an alias on the net for privacy.
On
On 4/27/2007 11:41 AM, Gabor Grothendieck wrote:
I don't think there is any requirement to identify yourself in any
way nor should their be. Many people on the list are in academia
and in those cases they probably want their name in lights but
others may wish to have a lower profile and its
I think Duncan's suggestion that the poster work it out for
him/her self is perfectly reasonable. People can be anonymous
all they like. Those of us who are made suspicious by this
anonymity (what have they got to hide?) can decline to provide
assistance.
cheers,
Dear List,
Below is a simple, standard loss model that takes into account the
terms of an insurance policy:
deductible - 15
coverage.limit - 75
insurance.threshold - deductible + coverage.limit
tmpf - function() {
loss - rlnorm(rpois(1, 3), 2, 5)
sum(ifelse(loss insurance.threshold, loss -
On 4/26/2007 12:48 PM, xpRt.wannabe wrote:
Dear List,
Below is a simple, standard loss model that takes into account the
terms of an insurance policy:
deductible - 15
coverage.limit - 75
insurance.threshold - deductible + coverage.limit
tmpf - function() {
loss - rlnorm(rpois(1, 3),
Just to be sure, is what I have below the right intepretation of your
suggestion:
deductible - 15
coverage.limit - 75
insurance.threshold - deductible + coverage.limit
tmpf - function() {
loss - rlnorm(rpois(1, 3), 2, 5)
n - length(loss)
accept - runif(n) 0.8
payout - runif(n) 0.999
On 4/26/2007 2:31 PM, xpRt.wannabe wrote:
Just to be sure, is what I have below the right intepretation of your
suggestion:
Yes, that's what I suggested.
Duncan Murdoch
deductible - 15
coverage.limit - 75
insurance.threshold - deductible + coverage.limit
tmpf - function() {
loss -
I made a few slight modifications to the original model in an effort
to see the inner workings of the code:
deductible - 1
coverage.limit - 2
insurance.threshold - deductible + coverage.limit
snip
set.seed(123)
loss - abs(rnorm(rpois(1, 5), 1, 3))
n - length(loss)
accept - runif(n) 0.8
payout
On 4/26/2007 5:21 PM, xpRt.wannabe wrote:
I made a few slight modifications to the original model in an effort
to see the inner workings of the code:
deductible - 1
coverage.limit - 2
insurance.threshold - deductible + coverage.limit
snip
set.seed(123)
loss - abs(rnorm(rpois(1, 5),
xpRt.wannabe wrote:
Uwe and Ben,
Thank you both for your help.
To me, both sets of code seem to do the job and should produce the
same results. However, as a test I inserted set.seed( ) as follows.
Unless I put set.seed( ) in the wrong lines, the results produced by
both sets of code
xpRt.wannabe wrote:
Dear List:
I have the follow code:
y - replicate(10,replicate(8,sum(rnorm(rpois(1,5)
Now I need to apply the following condition to _every_ randomly generated
Normal number in the code above:
x - max(0,x-15) + max(0,x-90), where x represents the individual
Uwe Ligges ligges at statistik.uni-dortmund.de writes:
xpRt.wannabe wrote:
y - replicate(10,replicate(8,sum(rnorm(rpois(1,5)
x - max(0,x-15) + max(0,x-90), where x represents the individual Normal
numbers.
y - replicate(10, {
rp - rpois(8, 5)
mysum -
Uwe and Ben,
Thank you both for your help.
To me, both sets of code seem to do the job and should produce the
same results. However, as a test I inserted set.seed( ) as follows.
Unless I put set.seed( ) in the wrong lines, the results produced by
both sets of code turn out to be different. I
Dear List:
I have the follow code:
y - replicate(10,replicate(8,sum(rnorm(rpois(1,5)
Now I need to apply the following condition to _every_ randomly generated
Normal number in the code above:
x - max(0,x-15) + max(0,x-90), where x represents the individual Normal
numbers.
In other words,
Dear List,
I have the following code that does what I want:
x - replicate(5,replicate(10,sum(rnorm(rpois(1,10)
How might one change it such that the maximum value generated by
rnorm(rpois(1,10)) can be retrieved for later use?
__
On 12/08/05 05:55, xpRt.wannabe wrote,:
Dear List,
I have the following code that does what I want:
x - replicate(5,replicate(10,sum(rnorm(rpois(1,10)
How might one change it such that the maximum value generated by
rnorm(rpois(1,10)) can be retrieved for later use?
set.seed(99)
x
Jim and List,
Thank you for the prompt reply. Perhaps I should have been more
specific in the way I phrased the question.
The code you gave would return the max value just one time. I was
interested in getting as many max values generated by
rnorm(rpois(1,10)) as specified by:
Ted and List,
In your code that produced 'mx', you dropped sum() from my original
code though. As a result, the 10 x 5 max's are of the same value.
Unfortunately, that's not what I need.
On 8/11/05, ecatchpole [EMAIL PROTECTED] wrote:
On 12/08/05 05:55, xpRt.wannabe wrote,:
Dear List,
Sorry, I don't follow. What's wrong with this?
Ted.
set.seed(99)
x - replicate(5,replicate(10,sum(rnorm(rpois(1,10)
set.seed(99)
mx - replicate(5,replicate(10,max(rnorm(rpois(1,10)
x
[,1][,2][,3] [,4] [,5]
[1,] -2.0071674 -7.0883335
Ted and List,
What I need is I need to know what max of rnorm(rpois(1,10)) is before
R does sum(), replicate(10, ...) and replicate(5, ...).
The fact that you have set.seed(99) twice, does that mean, say, entry
[1,1] 0.4896243 in 'mx' is one of the z number of values generated by
On 12/08/05 13:27, xpRt.wannabe wrote,:
Ted and List,
What I need is I need to know what max of rnorm(rpois(1,10)) is before
R does sum(), replicate(10, ...) and replicate(5, ...).
The fact that you have set.seed(99) twice, does that mean, say, entry
[1,1] 0.4896243 in 'mx' is one of the
Thank you! That was helpful.
Another thing I learned was that I would need to do set.seed(99) not
once but twice in this context.
On 8/11/05, ecatchpole [EMAIL PROTECTED] wrote:
On 12/08/05 13:27, xpRt.wannabe wrote,:
Ted and List,
What I need is I need to know what max of
28 matches
Mail list logo