Dear all, As I am new to the R community - although eager to advance- I would like to pose a question to the community. I have an SPSS file which I have imported it in R (with the read.spss command) which conists of scale (continuous) variable "adiponectin" and the corresponding categorical value "death" (0=No, 1=Yes). In all there are 60 observations (among which there are 26 events). I am trying to do rcspline.plot (model="logisitc", nk=5, knots=NULL) however the error message that i get is "fewer than 6 non missing observations". I have repeated the process with a similar dataset of 300 observations (instead of 60) and I still get the same message. Can anybody suggest a hint ? Kind regards Georgios Chalikias MD,PhD Senior Lecturer in Cardiology Democritus University of Thrace Alexandroupolis, Greece
The error message is literally true, as you did not specify any data to the function at all. Please read the documentation. Also, note that rcspline.plot is largely replaced by the R rms package, although it may have value if there is only one predictor and that predictor is continuous. Also note spelling of "logistic". You will need to load the rms package when using rcspline.plot anyway. When reading SPSS files you may find the Hmisc package's spss.get function useful. You've already loaded Hmisc if using rcspline.plot. Please follow the posting guide. Frank Georgios Chalikias wrote:> > Dear all, > > As I am new to the R community - although eager to advance- I would > like to pose a question to the community. > > I have an SPSS file which I have imported it in R (with the read.spss > command) which conists of scale (continuous) variable "adiponectin" and > the corresponding categorical value "death" (0=No, 1=Yes). In all there > are 60 observations (among which there are 26 events). > > I am trying to do rcspline.plot (model="logisitc", nk=5, knots=NULL) > however the error message that i get is "fewer than 6 non missing > observations". > > I have repeated the process with a similar dataset of 300 observations > (instead of 60) and I still get the same message. > > Can anybody suggest a hint ? > > Kind regards > > Georgios Chalikias MD,PhD > Senior Lecturer in Cardiology > Democritus University of Thrace > Alexandroupolis, Greece > > ______________________________________________ > R-help at r-project.org 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. >----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/rcspline-plot-query-tp3590233p3590392.html Sent from the R help mailing list archive at Nabble.com.
The actual dataframe that I have imported on R is Death adp 1 0 58.00 2 1 18.70 3 0 21.75 4 1 25.35 5 0 20.55 6 1 28.05 7 0 50.15 8 1 31.25 9 1 32.75 10 1 28.95 11 1 15.10 12 0 45.05 13 1 19.95 14 0 32.95 15 0 22.60 16 0 10.75 17 0 41.80 18 0 27.05 19 1 26.25 20 0 34.40 21 1 24.65 22 1 42.30 23 0 19.80 24 0 47.20 25 1 25.90 26 1 30.70 27 1 28.60 28 1 25.80 29 0 27.05 30 0 14.40 31 0 28.40 32 0 48.45 33 0 17.85 34 1 30.85 35 1 24.75 36 0 16.20 37 0 34.10 38 0 12.00 39 0 24.40 40 0 69.50 41 1 36.45 42 0 41.55 43 1 17.80 44 0 40.10 45 1 21.35 46 1 22.90 47 0 63.80 48 1 45.80 49 0 70.65 50 0 54.00 51 0 26.90 52 0 50.75 53 0 28.20 54 1 23.25 55 1 18.10 56 0 29.20 57 1 52.80 58 0 46.60 59 1 32.55 60 0 74.50 The R command that I actually use is > rcspline.plot ("adp", "Death", model="logistic", nk=3, knots=NULL) and the >rcspline.eval ("adp", nk=3, inclx=FALSE, knots.only=FALSE, type="ordinary") For both the commands I receive the same message : " fewer than 6 non missing observations". George -- View this message in context: http://r.789695.n4.nabble.com/rcspline-plot-query-tp3590233p3591679.html Sent from the R help mailing list archive at Nabble.com.
Please see my previous note and please read the documentation. Also note the difference between a character string literal in quotes and the name of a vector, which is usually not quoted. Frank Chalikias George wrote:> > The actual dataframe that I have imported on R is > > Death adp > 1 0 58.00 > 2 1 18.70 > 3 0 21.75 > 4 1 25.35 > 5 0 20.55 > 6 1 28.05 > 7 0 50.15 > 8 1 31.25 > 9 1 32.75 > 10 1 28.95 > 11 1 15.10 > 12 0 45.05 > 13 1 19.95 > 14 0 32.95 > 15 0 22.60 > 16 0 10.75 > 17 0 41.80 > 18 0 27.05 > 19 1 26.25 > 20 0 34.40 > 21 1 24.65 > 22 1 42.30 > 23 0 19.80 > 24 0 47.20 > 25 1 25.90 > 26 1 30.70 > 27 1 28.60 > 28 1 25.80 > 29 0 27.05 > 30 0 14.40 > 31 0 28.40 > 32 0 48.45 > 33 0 17.85 > 34 1 30.85 > 35 1 24.75 > 36 0 16.20 > 37 0 34.10 > 38 0 12.00 > 39 0 24.40 > 40 0 69.50 > 41 1 36.45 > 42 0 41.55 > 43 1 17.80 > 44 0 40.10 > 45 1 21.35 > 46 1 22.90 > 47 0 63.80 > 48 1 45.80 > 49 0 70.65 > 50 0 54.00 > 51 0 26.90 > 52 0 50.75 > 53 0 28.20 > 54 1 23.25 > 55 1 18.10 > 56 0 29.20 > 57 1 52.80 > 58 0 46.60 > 59 1 32.55 > 60 0 74.50 > > The R command that I actually use is > rcspline.plot ("adp", "Death", > model="logistic", nk=3, knots=NULL) > > and the >rcspline.eval ("adp", nk=3, inclx=FALSE, knots.only=FALSE, > type="ordinary") > > For both the commands I receive the same message : " fewer than 6 non > missing observations". > > George >----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/rcspline-plot-query-tp3590233p3591951.html Sent from the R help mailing list archive at Nabble.com.