[R] Problem with installing Hmisc and Design: gfrotran: error
cannot exec 'f951': No such file or directory Reply-To: Hi all, I'm using R on an Suse Linux system. Since Hmisc and Design need both fortran, I installed gfortran (through rpm). However, I still get an error message, namely: gfrotran: error cannot exec 'f951': No such file or directory And the installation is cancelled. I tried solving the problem through googling it, and looking at the fortran and Hmisc page, but couldn't find any valuable information. It would be wonderful if anyone could help me. Cheers, Stephan -- --- Stephan Lindner, Dipl.Vw., MA PhD Candidate University of Michigan __ 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 and provide commented, minimal, self-contained, reproducible code.
[R] using weights in lrm
Dear all, just a quick question regarding weights in logistic regression. I do results - lrm(y.js ~ h.hhsize + h.death1 + h.ill1 + h.ljob1 + h.fin1 + h.div1 + h.fail1 + h.sex + h.ch.1 + h.ch.5 + h.ch.12 + h.ch.13 + h.popgroup + y.school.now ,x=T,y=T, data=d.caps1y, weights=weightsd, normwt=TRUE ) The regression works (in the sense that the results are not way off the one w/o wighting the sample), but I get the following warning messages: Warning messages: 1: number of items to replace is not a multiple of replacement length 2: currently weights are ignored in model validation and bootstrapping lrm fits in: lrm(y.js ~ h.hhsize + h.death1 + h.ill1 + h.ljob1 + h.fin1 + Perhaps someone can help me clearifying the warning messages -- thanks a lot in advance ! Cheers, Stephan -- --- Stephan Lindner, Dipl.Vw. Doctoral Student in Economics 1512 Gilbert Ct., V-17 Ann Arbor, Michigan 48105 U.S.A. Tel.: 001-734-272-2437 E-Mail: [EMAIL PROTECTED] If I have seen further it is by standing on the shoulders of giants. -- Isaac Newton __ 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] using weights in lrm
Dear all, here's my own answer to the first warning message -- the warning message comes from handling missing values, which is specified as na.delte as default in lrm. Cheers, Stephan # Consider a toy data frame: d.temp y.js h.hhsize h.work.frac h.age h.sex h.popgroup weightsd cluster 1No3 0.33320 female Coloured 47.800621001 2No5 0.60018 female Coloured 47.800621001 3 Yes4 0.75018 female White 47.800621001 4 Yes6 0.50021 female Coloured 49.712641002 5No6 0.50015 female Coloured 49.712641002 6No3 0.66720 female White 49.712641002 7No3 0.33321 female White 49.712641002 8 Yes6 0.66719 female White 49.712641002 9No6 0.66716 male White 49.712641002 10 No3 0.33316 male Coloured 49.712641002 11 No5 0.40015 male Coloured 42.855721003 12 No6 0.66718 male White 42.855721003 13 No4 0.25017 male White 45.888601004 14 No3 0.33315 female Coloured 45.888601004 15 No4 0.50019 female White 45.888601004 16 Yes4 0.50016 female White 45.888601004 17 Yes6 0.33321 female Coloured 45.888601004 18 No3 0.66715 female White 46.030221005 19 Yes5 0.40020 female White 46.030221005 20 No5 1.00019 female White 46.030221005 # The dependent variable has no missing values. Then, lrm works fine. results - robcov(ols.results - lrm(y.js ~ + h.hhsize + h.work.frac + factor(h.age) + h.sex + h.popgroup ,data=d.temp,x=T,y=T ,weights=weightsd, normwt=TRUE), d.temp$cluster) # Now change the first observation to a missing value: d.temp$y.js[1] - NA # and do the same again produces the warning: results - robcov(ols.results - lrm(y.js ~ + h.hhsize + h.work.frac + factor(h.age) + h.sex + h.popgroup ,data=d.temp,x=T,y=T ,weights=weightsd, normwt=TRUE), d.temp$cluster) # But specifying na.action=exclude resolves it. results - robcov(ols.results - lrm(y.js ~ + h.hhsize + h.work.frac + factor(h.age) + h.sex + h.popgroup ,data=d.temp,x=T,y=T, na.action=na.exclude ,weights=weightsd, normwt=TRUE), d.temp$cluster) # --- # On Tue, Jul 04, 2006 at 07:59:31AM -0500, Frank E Harrell Jr wrote: Stephan Lindner wrote: Dear all, just a quick question regarding weights in logistic regression. I do results - lrm(y.js ~ h.hhsize + h.death1 + h.ill1 + h.ljob1 + h.fin1 + h.div1 + h.fail1 + h.sex + h.ch.1 + h.ch.5 + h.ch.12 + h.ch.13 + h.popgroup + y.school.now ,x=T,y=T, data=d.caps1y, weights=weightsd, normwt=TRUE ) The regression works (in the sense that the results are not way off the one w/o wighting the sample), but I get the following warning messages: Warning messages: 1: number of items to replace is not a multiple of replacement length 2: currently weights are ignored in model validation and bootstrapping lrm fits in: lrm(y.js ~ h.hhsize + h.death1 + h.ill1 + h.ljob1 + h.fin1 + Perhaps someone can help me clearifying the warning messages -- thanks a lot in advance ! I think the second warning is clear. Regarding the first, make sure that the weights
[R] Create variables with common values for each group
Dear all, sorry, this is for sure really basic, but I searched a lot in the internet, and just couldn't find a solution. The problem is to create new variables from a data frame which contains both individual and group variables, such as mean age for an household. My data frame: df hhid h.age 1 1001002023 2 1001002023 3 1001012642 4 1001012660 5 1001014220 6 1001014249 7 1001014252 8 1001015018 9 1001015051 10 1001015028 where hhid is the same number for each household, h.age the age for each household member. I tried tapply, by(), and aggregate. The best I could get was: by(df, df$hhid, function(subset) rep(mean(subset$h.age,na.rm=T),nrow(subset))) df$hhid: 10010020 [1] 23 23 df$hhid: 10010126 [1] 51 51 df$hhid: 10010142 [1] 40.3 40.3 40.3 df$hhid: 10010150 [1] 32.3 32.3 32.3 Now I principally only would have to stack up the mean values, and this is where I'm stucked. The function aggregate works nice, and I could loop then, but I was wondering whether there is a better way to do that. My end result should look like this (assigning mean.age to the data frame): hhid h.age mean.age 1 1001002023 23.00 2 1001002023 23.00 3 1001012642 51.00 4 1001012660 51.00 5 1001014220 40.33 6 1001014249 40.33 7 1001014252 40.33 8 1001015018 32.33 9 1001015051 32.33 10 1001015028 32.33 Cheers, and thanks a lot, Stephan Lindner -- --- Stephan Lindner, Dipl.Vw. 1512 Gilbert Ct., V-17 Ann Arbor, Michigan 48105 U.S.A. Tel.: 001-734-272-2437 E-Mail: [EMAIL PROTECTED] The prevailing ideas of a time were always only the ideas of the ruling class -- Karl Marx __ 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