Re: [R] Logistic regression with constrained parameter ??
On Sat, 27 Aug 2005, Benn Fine wrote: I want to fit a logistic regression model under a specified null hypothesis, say Ho:Beta_k=1 Is there a way to constrain a parameter in glm.fit ?? You should be calling glm(). Then you can use offset() in your formula. (You can also use it as an argument, but please don't as it is only partially supported.) [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html PLEASE do (and notice what is says about HTML mail). -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] [newbie] Want to perform some simple regressions.
Hi, I am a very newbie to R, and also have no knowledge concerning statistics. Nevertheless I think R might be the right software for a very specific number theory problem I sometime have. Studying some properties, I often get sequences of real numbers (let's call them y, the index x being 0, 1, 2, 3, 4, ...). For instance the list below. After a quick look, it seems that the sequence below is very close to something like (a.x + b) ln (c.x + d) but I didn't manage to find something very good for (a,b,c,d). My number theory software (maxima and pari/gp) don't seem to be much helpful for this. Is R the right choice ? Please, could you step by step show me how you would do on this example (data below) in order to let me do it on other examples. It would be very nice to join a script of the session since I don't know yet the syntax of R commands. Regards, -- Thomas Baruchel __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] [newbie] Want to perform some simple regressions.
On Sun, Aug 28, 2005 at 09:48:15AM +0200, Thomas Baruchel wrote: Is R the right choice ? Please, could you step by step show me how you would do on this example (data below) in order to let me I forgot my data :-( 0 2.205954909440447 1 8.150580118785099 2 15.851323727378597 3 22.442795956953574 4 29.358579800271354 5 36.46060528847214 6 43.7516923268591 7 51.223688311610026 8 58.86610205087116 9 66.66821956399055 10 74.61990268453171 11 82.71184423952718 12 90.93560520053082 13 99.28356700194489 14 107.74885489906521 15 116.3252559311549 16 125.00714110112291 17 133.78939523822717 18 142.6673553086964 19 151.63675679510055 20 160.69368733376777 21 169.834546691509 22 179.05601219606618 23 188.35500882314003 24 197.72868324657364 25 207.17438125936408 26 216.68962806440814 27 226.2721110130965 28 235.9196644372003 29 245.63025627606442 30 255.40197624835042 31 265.23302535689197 32 275.12170654792556 33 285.06641637317705 34 295.0656375259694 35 305.1179321414606 36 315.2219357669857 37 325.3763519217964 38 335.5799471767038 39 345.8315466936063 40 356.13003017290697 41 366.4743281636434 42 376.8634186969678 43 387.2963242085816 44 397.77210871999046 45 408.2898752521091 46 418.8487634479048 47 429.44794738349896 48 440.08663354951693 49 450.76405898653184 50 461.479489560246 51 472.2322183636179 52 483.02156423451737 53 493.84687037869463 54 504.707503088911 55 515.6028505520102 56 526.5323217365377 57 537.4953453542455 58 548.4913688894654 59 559.5198576909147 60 570.5802941210067 61 581.6721767581994 62 592.7950196483222 63 603.9483516011882 64 615.1317155291274 65 626.3446678243708 66 637.586724806 67 648.8576269992603 68 660.1568089487967 69 671.4839283904737 70 682.838600952985 71 694.2204526835204 72 705.6291196304554 73 717.0642474479981 74 728.5254910213728 75 740.0125141112243 76 751.5249890160294 77 763.062596251391 78 774.6250242451752 79 786.2119690475241 80 797.8231340548524 81 809.4582297469931 82 821.1169734367211 83 832.7990890309349 84 844.5043068028273 85 856.2323631744205 Regards, -- Thomas Baruchel __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] [newbie] Want to perform some simple regressions.
Hi Thomas, I'm not an expert - so I might use incorrect terminology, but hopefully you'll get the picture! Assuming that you've got your data in a .CSV file, you'd first read in your data, where the first three lines might look like... x,y 0,2.205954909440447 1,8.150580118785099 # load the info into a data.frame called mydata mydata - read.csv(mycsvfile.csv,header=TRUE) # now attach to this data.frame, so that the internal attach(mydata) # now do the regression and store it in the object myregr myregr - lm(y~x) # print out the info from myregr myregr # to get more info from myregr use the summary() method... summary(myregr) There is an enormous quantity of documentation available, though it takes a little while to learn to use it properly and get the full effectiveness from it... I strongly recommend that you read the Posting Guide http://www.R-project.org/posting-guide.html which will help you. For more information, have a look at the introduction to R; which is a tad terse in places - so read it slowly :-) Have a look also at the other documentation http://www.r-project.org/other-docs.html In particular I'd recommend John Maindonalds online book at http://cran.r-project.org/other-docs.html cheers! Sean On 28/08/05, Thomas Baruchel [EMAIL PROTECTED] wrote: On Sun, Aug 28, 2005 at 09:48:15AM +0200, Thomas Baruchel wrote: Is R the right choice ? Please, could you step by step show me how you would do on this example (data below) in order to let me I forgot my data :-( 0 2.205954909440447 1 8.150580118785099 2 15.851323727378597 3 22.442795956953574 4 29.358579800271354 5 36.46060528847214 6 43.7516923268591 7 51.223688311610026 8 58.86610205087116 9 66.66821956399055 10 74.61990268453171 11 82.71184423952718 12 90.93560520053082 13 99.28356700194489 14 107.74885489906521 15 116.3252559311549 16 125.00714110112291 17 133.78939523822717 18 142.6673553086964 19 151.63675679510055 20 160.69368733376777 21 169.834546691509 22 179.05601219606618 23 188.35500882314003 24 197.72868324657364 25 207.17438125936408 26 216.68962806440814 27 226.2721110130965 28 235.9196644372003 29 245.63025627606442 30 255.40197624835042 31 265.23302535689197 32 275.12170654792556 33 285.06641637317705 34 295.0656375259694 35 305.1179321414606 36 315.2219357669857 37 325.3763519217964 38 335.5799471767038 39 345.8315466936063 40 356.13003017290697 41 366.4743281636434 42 376.8634186969678 43 387.2963242085816 44 397.77210871999046 45 408.2898752521091 46 418.8487634479048 47 429.44794738349896 48 440.08663354951693 49 450.76405898653184 50 461.479489560246 51 472.2322183636179 52 483.02156423451737 53 493.84687037869463 54 504.707503088911 55 515.6028505520102 56 526.5323217365377 57 537.4953453542455 58 548.4913688894654 59 559.5198576909147 60 570.5802941210067 61 581.6721767581994 62 592.7950196483222 63 603.9483516011882 64 615.1317155291274 65 626.3446678243708 66 637.586724806 67 648.8576269992603 68 660.1568089487967 69 671.4839283904737 70 682.838600952985 71 694.2204526835204 72 705.6291196304554 73 717.0642474479981 74 728.5254910213728 75 740.0125141112243 76 751.5249890160294 77 763.062596251391 78 774.6250242451752 79 786.2119690475241 80 797.8231340548524 81 809.4582297469931 82 821.1169734367211 83 832.7990890309349 84 844.5043068028273 85 856.2323631744205 Regards, -- Thomas Baruchel __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] [newbie] Want to perform some simple regressions.
Sean O'Riordain wrote: Hi Thomas, I'm not an expert - so I might use incorrect terminology, but hopefully you'll get the picture! Assuming that you've got your data in a .CSV file, you'd first read in your data, where the first three lines might look like... x,y 0,2.205954909440447 1,8.150580118785099 # load the info into a data.frame called mydata mydata - read.csv(mycsvfile.csv,header=TRUE) # now attach to this data.frame, so that the internal attach(mydata) # now do the regression and store it in the object myregr myregr - lm(y~x) Thomas's model was y = (a*x + b) * ln (c*x + d) + error which is not a linear model. He'll need to use nonlinear regression (the nls function), which is a little more complicated. I'd recommend geting local help from a statistician to get it right. Duncan Murdoch # print out the info from myregr myregr # to get more info from myregr use the summary() method... summary(myregr) There is an enormous quantity of documentation available, though it takes a little while to learn to use it properly and get the full effectiveness from it... I strongly recommend that you read the Posting Guide http://www.R-project.org/posting-guide.html which will help you. For more information, have a look at the introduction to R; which is a tad terse in places - so read it slowly :-) Have a look also at the other documentation http://www.r-project.org/other-docs.html In particular I'd recommend John Maindonalds online book at http://cran.r-project.org/other-docs.html cheers! Sean On 28/08/05, Thomas Baruchel [EMAIL PROTECTED] wrote: On Sun, Aug 28, 2005 at 09:48:15AM +0200, Thomas Baruchel wrote: Is R the right choice ? Please, could you step by step show me how you would do on this example (data below) in order to let me I forgot my data :-( 0 2.205954909440447 1 8.150580118785099 2 15.851323727378597 3 22.442795956953574 4 29.358579800271354 5 36.46060528847214 6 43.7516923268591 7 51.223688311610026 8 58.86610205087116 9 66.66821956399055 10 74.61990268453171 11 82.71184423952718 12 90.93560520053082 13 99.28356700194489 14 107.74885489906521 15 116.3252559311549 16 125.00714110112291 17 133.78939523822717 18 142.6673553086964 19 151.63675679510055 20 160.69368733376777 21 169.834546691509 22 179.05601219606618 23 188.35500882314003 24 197.72868324657364 25 207.17438125936408 26 216.68962806440814 27 226.2721110130965 28 235.9196644372003 29 245.63025627606442 30 255.40197624835042 31 265.23302535689197 32 275.12170654792556 33 285.06641637317705 34 295.0656375259694 35 305.1179321414606 36 315.2219357669857 37 325.3763519217964 38 335.5799471767038 39 345.8315466936063 40 356.13003017290697 41 366.4743281636434 42 376.8634186969678 43 387.2963242085816 44 397.77210871999046 45 408.2898752521091 46 418.8487634479048 47 429.44794738349896 48 440.08663354951693 49 450.76405898653184 50 461.479489560246 51 472.2322183636179 52 483.02156423451737 53 493.84687037869463 54 504.707503088911 55 515.6028505520102 56 526.5323217365377 57 537.4953453542455 58 548.4913688894654 59 559.5198576909147 60 570.5802941210067 61 581.6721767581994 62 592.7950196483222 63 603.9483516011882 64 615.1317155291274 65 626.3446678243708 66 637.586724806 67 648.8576269992603 68 660.1568089487967 69 671.4839283904737 70 682.838600952985 71 694.2204526835204 72 705.6291196304554 73 717.0642474479981 74 728.5254910213728 75 740.0125141112243 76 751.5249890160294 77 763.062596251391 78 774.6250242451752 79 786.2119690475241 80 797.8231340548524 81 809.4582297469931 82 821.1169734367211 83 832.7990890309349 84 844.5043068028273 85 856.2323631744205 Regards, -- Thomas Baruchel __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] [newbie] Want to perform some simple regressions.
try 'nls' Here is your data applied to it. It looks like you had an 'exact' fit: x.1[1:10,] V1V2 1 0 2.205955 2 1 8.150580 3 2 15.851324 4 3 22.442796 5 4 29.358580 6 5 36.460605 7 6 43.751692 8 7 51.223688 9 8 58.866102 10 9 66.668220 x.p - nls(V2 ~ (a*V1+b)*log(c*V1+d),x.1,start=list(a=1,b=1,c=1,d=1)) x.p Nonlinear regression model model: V2 ~ (a * V1 + b) * log(c * V1 + d) data: x.1 abcd 1.994722 6.807986 1.495003 1.301922 residual sum-of-squares: 1.006867 On 8/28/05, Thomas Baruchel [EMAIL PROTECTED] wrote: On Sun, Aug 28, 2005 at 09:48:15AM +0200, Thomas Baruchel wrote: Is R the right choice ? Please, could you step by step show me how you would do on this example (data below) in order to let me I forgot my data :-( 0 2.205954909440447 1 8.150580118785099 2 15.851323727378597 3 22.442795956953574 4 29.358579800271354 5 36.46060528847214 6 43.7516923268591 7 51.223688311610026 8 58.86610205087116 9 66.66821956399055 10 74.61990268453171 11 82.71184423952718 12 90.93560520053082 13 99.28356700194489 14 107.74885489906521 15 116.3252559311549 16 125.00714110112291 17 133.78939523822717 18 142.6673553086964 19 151.63675679510055 20 160.69368733376777 21 169.834546691509 22 179.05601219606618 23 188.35500882314003 24 197.72868324657364 25 207.17438125936408 26 216.68962806440814 27 226.2721110130965 28 235.9196644372003 29 245.63025627606442 30 255.40197624835042 31 265.23302535689197 32 275.12170654792556 33 285.06641637317705 34 295.0656375259694 35 305.1179321414606 36 315.2219357669857 37 325.3763519217964 38 335.5799471767038 39 345.8315466936063 40 356.13003017290697 41 366.4743281636434 42 376.8634186969678 43 387.2963242085816 44 397.77210871999046 45 408.2898752521091 46 418.8487634479048 47 429.44794738349896 48 440.08663354951693 49 450.76405898653184 50 461.479489560246 51 472.2322183636179 52 483.02156423451737 53 493.84687037869463 54 504.707503088911 55 515.6028505520102 56 526.5323217365377 57 537.4953453542455 58 548.4913688894654 59 559.5198576909147 60 570.5802941210067 61 581.6721767581994 62 592.7950196483222 63 603.9483516011882 64 615.1317155291274 65 626.3446678243708 66 637.586724806 67 648.8576269992603 68 660.1568089487967 69 671.4839283904737 70 682.838600952985 71 694.2204526835204 72 705.6291196304554 73 717.0642474479981 74 728.5254910213728 75 740.0125141112243 76 751.5249890160294 77 763.062596251391 78 774.6250242451752 79 786.2119690475241 80 797.8231340548524 81 809.4582297469931 82 821.1169734367211 83 832.7990890309349 84 844.5043068028273 85 856.2323631744205 Regards, -- Thomas Baruchel __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Jim Holtman Convergys +1 513 723 2929 What the problem you are trying to solve? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] printCoefmat with more p-values?
Lukasz Komsta wrote: Dear useRs, I would like to summarize results of several tests in groups of two columns - statistic, p-value, statistic, p-value etc. There would be nice to add significance stars, but printCoefmat allows to do it only to last column. Is there any way to do format such table without writing my own complicated function? Yes, I think you have to write your own function, but no need for a complicated one. ;-) Uwe Ligges Thank you in advance, __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] stratified Wilcoxon available?
Dear All, is there a stratified version of the Wilcoxon test (also known as van Elteren test) available in R? I could find it in the survdiff function of the survival package for censored data. I think, it should be possible to use this function creating a dummy censoring indicator and setting it to not censored, but may be there is a better way to perform the test. Thanks, Heinz Tüchler __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] predict.coxph
Is there anywhere to find more detail on the different types of predictions (lp, risk, terms) in predict.coxph? I would like to create a summary risk score after fitting a multivariable model with time-varying covariates. If it makes a difference, 0 will be a substantively meaningful value for all of the covariates considered. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] stratified Wilcoxon available?
Heinz Tuechler [EMAIL PROTECTED] writes: Dear All, is there a stratified version of the Wilcoxon test (also known as van Elteren test) available in R? I could find it in the survdiff function of the survival package for censored data. I think, it should be possible to use this function creating a dummy censoring indicator and setting it to not censored, but may be there is a better way to perform the test. Not easily, I think. I played with the stratified Kruskal Wallis test (which is the same thing for larger values of 2...) with a grad student some years ago, but we never got it integrated as an official R function. It was not massively hard to code, as I recall it. Basically, you convert observations to within-stratum ranks, scaled so that the scores have similar variance (this is crucial: just adding the per-stratum rank sums won't work). You can then get the relevant SSD from lm(), by comparing the models r ~ group + strata and r ~ strata. This SSD can be looked up as a chi-square statistic, possibly after applying a scale factor which I have forgotten (I.e. do your own math, don't trust me!) -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Statistics with R
Dear list, One year ago, some of you had wished for an English version of my web page Statistiques avec R. The translation is now completed. As the French version, this document is still unfinished, probably full of mistakes -- but amply illustrated. For those of you who had not browsed through the previous version, these are merely the notes I took while discovering statistics and using R, with as many pictures as possible (over a thousand). http://zoonek2.free.fr/UNIX/48_R/all.html Regards, -- Vincent __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] stratified Wilcoxon available?
Peter Dalgaard wrote: Heinz Tuechler [EMAIL PROTECTED] writes: Dear All, is there a stratified version of the Wilcoxon test (also known as van Elteren test) available in R? I could find it in the survdiff function of the survival package for censored data. I think, it should be possible to use this function creating a dummy censoring indicator and setting it to not censored, but may be there is a better way to perform the test. Not easily, I think. I played with the stratified Kruskal Wallis test (which is the same thing for larger values of 2...) with a grad student some years ago, but we never got it integrated as an official R function. It was not massively hard to code, as I recall it. Basically, you convert observations to within-stratum ranks, scaled so that the scores have similar variance (this is crucial: just adding the per-stratum rank sums won't work). You can then get the relevant SSD from lm(), by comparing the models r ~ group + strata and r ~ strata. This SSD can be looked up as a chi-square statistic, possibly after applying a scale factor which I have forgotten (I.e. do your own math, don't trust me!) You might think of such a stratified test as part of a proportional odds model with adjustment for strata as main effects. The Wilcoxon tests is a special case of the PO model. You can fit it with polr or lrm. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] stratified Wilcoxon available?
Thanks to Peter Dalgaard and Frank Harrell for your answers. Fortunately I don't have an urgent need for this test, but it may be in the future. Still I would be grateful if someone could comment on my opinion that using survdiff and regarding all the measures as events would lead to an equivalent test. Thanks, Heinz Tüchler At 15:18 28.08.2005 -0500, Frank E Harrell Jr wrote: Peter Dalgaard wrote: Heinz Tuechler [EMAIL PROTECTED] writes: Dear All, is there a stratified version of the Wilcoxon test (also known as van Elteren test) available in R? I could find it in the survdiff function of the survival package for censored data. I think, it should be possible to use this function creating a dummy censoring indicator and setting it to not censored, but may be there is a better way to perform the test. Not easily, I think. I played with the stratified Kruskal Wallis test (which is the same thing for larger values of 2...) with a grad student some years ago, but we never got it integrated as an official R function. It was not massively hard to code, as I recall it. Basically, you convert observations to within-stratum ranks, scaled so that the scores have similar variance (this is crucial: just adding the per-stratum rank sums won't work). You can then get the relevant SSD from lm(), by comparing the models r ~ group + strata and r ~ strata. This SSD can be looked up as a chi-square statistic, possibly after applying a scale factor which I have forgotten (I.e. do your own math, don't trust me!) You might think of such a stratified test as part of a proportional odds model with adjustment for strata as main effects. The Wilcoxon tests is a special case of the PO model. You can fit it with polr or lrm. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] PLSR: model notation and reliabilities
On Sat, Aug 27, 2005 at 04:04:13AM +0300, I.Ioannou wrote: I'm new in both R and statistics. I did my homework, but apparently it was not enough :-( I took a look inside the code of the *pls.fit functions and at least now I know where I got it wrong. So, I'm rephrasing my question : I have a model with 2 latent constructs (D1 and D2) each one made by 3 indicators (D1a, D1b, D1c etc). Also I have 2 moderating indicators (factors, m1, m2). The response (Y) is also a latent construct, with 3 indicators (Y1,Y2,Y3). Actually this is a simplified description of my model which is far more complicated. I want to express the regression using the constructs, both for the response and the predictors, i.e. I need to have inner and outer models. The outer model can be expressed as : Y ~ D1*m1 + D2*m2 How do I create the constructs from the indicators ? I suspect I have to use somehow mvr or pca, but I can not figure out how to use mvr for this since it uses a formula and the response is required, while princomp and prcomp gives me either more constructs than just 1, or ICRs ~ 0.6, while cronbach's alpha = 0.9 - apparently I'm not using them correctly. Any help will be much appreciated TIA __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Areas of Voronoi polygons in a given window
Hi, I'm using the package 'tripack' to look at the Voronoi tesselations of point patterns. I want to calculate the area of the intersection of each polygon with the unit square (in which all of my points lie). So far I have been using: voronoi.area(voronoi.mosaic(runif(10),runif(10))) This returns NA for edge polygons which are not bounded. However, their intersection with some bounded area is bounded. So, I'd like to know how to get the area of the intersection of each polygon with some defined area (ie. the unit square). Is this possible? Cheers, Jeremy -- [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] stratified Wilcoxon available?
On Sun, 28 Aug 2005, Heinz Tuechler wrote: Thanks to Peter Dalgaard and Frank Harrell for your answers. Fortunately I don't have an urgent need for this test, but it may be in the future. Still I would be grateful if someone could comment on my opinion that using survdiff and regarding all the measures as events would lead to an equivalent test. In the absence of ties, yes. In the presence of ties I think survdiff() does something slightly different from what would be usual for the Wilcoxon test. This would matter only with many tied observations. -thomas Thanks, Heinz Tüchler At 15:18 28.08.2005 -0500, Frank E Harrell Jr wrote: Peter Dalgaard wrote: Heinz Tuechler [EMAIL PROTECTED] writes: Dear All, is there a stratified version of the Wilcoxon test (also known as van Elteren test) available in R? I could find it in the survdiff function of the survival package for censored data. I think, it should be possible to use this function creating a dummy censoring indicator and setting it to not censored, but may be there is a better way to perform the test. Not easily, I think. I played with the stratified Kruskal Wallis test (which is the same thing for larger values of 2...) with a grad student some years ago, but we never got it integrated as an official R function. It was not massively hard to code, as I recall it. Basically, you convert observations to within-stratum ranks, scaled so that the scores have similar variance (this is crucial: just adding the per-stratum rank sums won't work). You can then get the relevant SSD from lm(), by comparing the models r ~ group + strata and r ~ strata. This SSD can be looked up as a chi-square statistic, possibly after applying a scale factor which I have forgotten (I.e. do your own math, don't trust me!) You might think of such a stratified test as part of a proportional odds model with adjustment for strata as main effects. The Wilcoxon tests is a special case of the PO model. You can fit it with polr or lrm. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Thomas Lumley Assoc. Professor, Biostatistics [EMAIL PROTECTED] University of Washington, Seattle__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html