[R] roc plot with zero length labels error

2009-10-29 Thread Chris Anderson
I am trying to create the roc plot bootstrap method from library(verification), 
and when I set the plot =both or emp then I get the following error. The 
roc.plot works fine when the plot is set to binorm. This is my first time using 
this function in R and am not sure what this error means or how to resolve the 
issue. It seems to work ok with the example dataset. Is there an option or data 
formatting I need to due to resolve this error? 
 
roc.plot((scicomp5.model1[164]==High Price), pred, CI = T, n.boot = 100, plot 
= 'both',binormal = TRUE,
+  main = paste('AREA UNDER CURVE (AUC) =', round(auc$A, 2)))
Error in text.default(DAT[id, 3, i], DAT[id, 2, i], plot.thres[id2], pos = 4,  
: 
  zero length 'labels'



Chris Anderson

http://www.seocodebreaker.com/?thankyou-page=429

Instant Debt Consolidation Quote
Free debt consolidation quote online! No obligation. No credit check.
http://thirdpartyoffers.netzero.net/TGL2241/c?cp=cyoog8NQa4mNZIgs6R2NrwAAJ1HbVVWM9bC-t-Va2hgXndJzAAQFAEWLnT8AAAMlABI2kQA=
[[alternative HTML version deleted]]

__
R-help@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.


[R] Help with RODBC connection to multiple MS SQL Sever databases

2009-07-15 Thread Chris Anderson
I'm trying to pull data from multiple MS SQL Sever databse in R. I can access 
the databases one at a time, but the tables are to large to pull the entire 
tables then join then in R. So I need to do a SQL join that will join the 
tables from the each of the databases. How do I combine the connection so that 
I can implement it in my sql query below. I'm currently getting the following 
error: 
region
[1] [RODBC] ERROR: Could not SQLExecDirect
 
[2] 42000 102 [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax 
near 'Completed'.

When I look at the tables from the contab-sqlTables(con), it is only getting 
information from one of the databases. 

library(RODBC)
dwparadigm-odbcConnect(dsn=dwParadigm, uid = X, pwd = XX, case = 
nochange, believeNRows = TRUE)
rptparadigm-odbcConnect(dsn=Rpt_Paradigm, uid = X, pwd = , case 
= nochange, believeNRows = TRUE)
wcrpt-odbcConnect(dsn=WC_Reporting, uid = X, pwd = X, case = 
nochange, believeNRows = TRUE)
con-odbcConnect(dsn=c(dwParadigm,Rpt_Paradigm,WC_Reporting)
 contab-sqlTables(con) 
  
 region-sqlQuery(con,'SELECT DISTINCT dbo_PATIENT.PATIENT, 
dbo_CONTRACT.CONTRACT, dbo_PATIENT.PATIENT_EPISODE, dbo_PATIENT.LAST_NAME, 
dbo_PATIENT.FIRST_NAME, dbo_CONTRACT.CON_STATUS, dbo_CONTRACT.CON_NUMBER, 
dbo_PATIENT.STATE, dbo_REGION_TERR.OPS_REGION, dbo_REGION_TERR.SPG_TERR, 
Sum(dbo_Line.total_ln_paid_amount) AS SumOftotal_ln_paid_amount
   FROM dbo_CONTRACT 
  INNER JOIN dbo_REGION_TERR
  RIGHT JOIN dbo_PATIENT 
  ON dbo_REGION_TERR.STATE = dbo_PATIENT.STATE
  ON dbo_CONTRACT.PATIENT = dbo_PATIENT.PATIENT 
  AND dbo_CONTRACT.PatientEpisodeID = 
dbo_PATIENT.PATIENT_EPISODE
  INNER JOIN dbo_Line 
ON dbo_PATIENT.PATIENT = dbo_Line.claim
 WHERE dbo_PATIENT.DIAGNOSIS_TYPE=ABI 
   AND dbo_CONTRACT.CON_STATUS In Completed
   AND dbo_CONTRACT.CON_NUMBER Like OP*
  GROUP BY dbo_PATIENT.PATIENT, dbo_CONTRACT.CONTRACT, 
dbo_PATIENT.PATIENT_EPISODE, dbo_PATIENT.LAST_NAME
, dbo_PATIENT.FIRST_NAME, 
dbo_CONTRACT.CON_STATUS, dbo_CONTRACT.CON_NUMBER, dbo_PATIENT.STATE
, dbo_REGION_TERR.OPS_REGION, 
dbo_REGION_TERR.SPG_TERR
   ')
 odbcCloseAll()
 
region
[1] [RODBC] ERROR: Could not SQLExecDirect
 
[2] 42000 102 [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax 
near 'Completed'.
 

 


Chris Anderson

http://www.seocodebreaker.com/?thankyou-page=429

The easiest way to create a blog. Click now!
http://thirdpartyoffers.netzero.net/TGL2241/fc/BLSrjpYRxiYGYCuyKabTb5JapHgbWqUjvZ4P8AguC0ACizbuKJCNdYf7SL2/
[[alternative HTML version deleted]]

__
R-help@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.


[R] Help resolving error in quantcut

2009-07-08 Thread Chris Anderson
I am trying to use the quantcut function to create deciles, but I am getting 
the error below. I am new to using this function and do not know how to 
properly use the options or some other conversion that is necessary.
#initial summary using describe function in Hmisc library
DegreeBurn4th 
  n missing  uniqueMean .05 .10 .25 .50 .75 .90 
.95 
 76 133  16  0.0325  0.  0.  0.  0.  0.0225  0.0900 
 0.1725 
  0 0.01 0.02 0.03 0.04 0.05 0.06 0.08 0.09 0.12 0.16 0.17 0.18 
0.24 0.36 0.5
Frequency 486342211211111   
 1   1
% 63845331131111
11   1
 degree.quant = quantcut(DegreeBurn4th, q=seq(0, 1, 0.1), labels=F,na.rm=TRUE)
Error in if (sum(flag) == 0) return(cut) else return(min(x[flag], na.rm = 
na.rm)) : 
  missing value where TRUE/FALSE needed

#orignal data
print(DegreeBurn4th)
  [1] 0.09 0.00 0.00   NA   NA 0.03   NA 0.02   NA 0.00 0.01 0.00   NA   NA   
NA   NA   NA 0.00   NA 0.05 0.03 0.00   NA 0.02 0.00   NA 0.00   NA   NA 0.16   
NA   NA 0.24
 [34]   NA   NA 0.00   NA 0.00 0.08   NA   NA   NA 0.00 0.00   NA   NA 0.01   
NA 0.09   NA 0.00 0.00 0.00 0.06   NA 0.00   NA   NA 0.00   NA   NA 0.00 0.01   
NA   NA 0.00
 [67]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA 
0.00 0.00   NA   NA 0.00   NA 0.05 0.00   NA   NA   NA 0.00 0.02 0.18   NA   NA 
  NA 0.03   NA
[100]   NA 0.00   NA   NA   NA 0.36   NA   NA   NA   NA 0.00 0.00 0.00   NA 
0.00   NA 0.17   NA 0.00   NA   NA   NA 0.00   NA 0.00 0.00 0.00   NA   NA 0.12 
0.00   NA 0.01
[133] 0.00   NA   NA   NA   NA 0.00 0.00   NA 0.01 0.00 0.00   NA   NA 0.00 
0.04   NA   NA   NA 0.00 0.00   NA 0.03   NA 0.00   NA 0.00   NA   NA 0.01 0.00 
0.00   NA   NA
[166]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA 0.00   NA   
NA   NA   NA   NA   NA   NA   NA   NA   NA 0.50   NA   NA   NA   NA   NA   NA   
NA   NA 0.04
[199]   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA   NA
#convert missing to zero
 DegreeBurn4th[is.na(DegreeBurn4th)]-0.00
 print(DegreeBurn4th)
  [1] 0.09 0.00 0.00 0.00 0.00 0.03 0.00 0.02 0.00 0.00 0.01 0.00 0.00 0.00 
0.00 0.00 0.00 0.00 0.00 0.05 0.03 0.00 0.00 0.02 0.00 0.00 0.00 0.00 0.00 0.16 
0.00 0.00 0.24
 [34] 0.00 0.00 0.00 0.00 0.00 0.08 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.01 
0.00 0.09 0.00 0.00 0.00 0.00 0.06 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.01 
0.00 0.00 0.00
 [67] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 
0.00 0.00 0.00 0.00 0.00 0.00 0.05 0.00 0.00 0.00 0.00 0.00 0.02 0.18 0.00 0.00 
0.00 0.03 0.00
[100] 0.00 0.00 0.00 0.00 0.00 0.36 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 
0.00 0.00 0.17 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.12 
0.00 0.00 0.01
[133] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.00 0.00 0.00 0.00 0.00 
0.04 0.00 0.00 0.00 0.00 0.00 0.00 0.03 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.00 
0.00 0.00 0.00
[166] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 
0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 
0.00 0.00 0.04
[199] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
 degree.quant = quantcut(DegreeBurn4th, q=seq(0, 1, 0.1), labels=F,na.rm=TRUE)
Error in if (pairs[1, i] == pairs[1, i - 1]  pairs[1, i] == pairs[2,  : 
  missing value where TRUE/FALSE needed
 degree.quant = quantcut(DegreeBurn4th, q=seq(0, 1, 0.1), 
 labels=F,include.lowest=TRUE)
Error in cut.default(x[!flag], breaks = newquant, include.lowest = TRUE,  : 
  formal argument include.lowest matched by multiple actual arguments
 degree.quant = quantcut(DegreeBurn4th, q=seq(0, 1, 0.1), 
 labels=F,include.lowest=F)
Error in cut.default(x[!flag], breaks = newquant, include.lowest = TRUE,  : 
  formal argument include.lowest matched by multiple actual arguments
 degree.quant = quantcut(DegreeBurn4th, q=seq(0, 1, 0.1), 
 labels=F,include.lowest=T)
Error in cut.default(x[!flag], breaks = newquant, include.lowest = TRUE,  : 
  formal argument include.lowest matched by multiple actual arguments
 



Chris Anderson

http://www.seocodebreaker.com/?thankyou-page=429

Criminal Lawyers - Click here.
http://thirdpartyoffers.netzero.net/TGL2241/fc/BLSrjpYbd6xeB8PyC2qYcdt9oup93MpUqzGGHKa4mySkwS9XNfuLPlvlNq4/
[[alternative HTML version deleted]]

__
R-help@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.


[R] help exporting to excel via xlsReadWritePro

2009-07-02 Thread Chris Anderson
I’m trying to export a file from R to excel using the xlsReadWritePro function 
and I keep getting the error below.   I get the same error when I use the 
oledatetime function.  My current date format is mm/dd/, which is how I 
want it in excel.  Also is there anyway to export different datasets to  
multiple sheets similar to the ods function in SAS? 
?xml:namespace prefix = o ns = urn:schemas-microsoft-com:office:office / 
library(xlsReadWritePro)
write.xls(rancho,file=H:\\Chris A\\Brain Injury\\Data\\rancho3.xls)
Error in write.xls(rancho, file = H:\\Chris A\\Brain 
Injury\\Data\\rancho3.xls) : 
  POSIXt is not a valid entry (try: 
unassigned/double/numeric/integer/logical/character/factor/NA/oledate/oletime/oledatetime/isodate/isotime/isodatetime/link/formula/mixed/mixedCharacter/mixedFactor)
 
 
write.xls(rancho,file=H:\\Chris A\\Brain Injury\\Data\\rancho3.xls,dateTimeAs 
= oledatetime)
Error in write.xls(rancho, file = H:\\Chris A\\Brain 
Injury\\Data\\rancho3.xls,  : 
  POSIXt is not a valid entry (try: 
unassigned/double/numeric/integer/logical/character/factor/NA/oledate/oletime/oledatetime/isodate/isotime/isodatetime/link/formula/mixed/mixedCharacter/mixedFactor)
 



Chris Anderson
707.315.8486
www.sassydeals4u.com

Save on Criminal Lawyer Services. Click Now!
http://thirdpartyoffers.netzero.net/TGL2241/fc/BLSrjpYbd6x4nBy5Jx35gNadAcucOpjXKqZUZ0Ak7EUZFLp3rBhwqdFMHU8/
[[alternative HTML version deleted]]

__
R-help@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.


[R] Export data to Multiple Sheets in Excel via xlsReadWritePro

2009-07-02 Thread Chris Anderson
Is there a way to export multiple datasets into multiple excel spreadsheets 
using xlsReadWritePro or with xlsReadWrite?


Chris Anderson
707.315.8486
www.sassydeals4u.com

Turn any room into a work of art. Click now for beautiful oriental rugs!
http://thirdpartyoffers.netzero.net/TGL2241/fc/BLSrjpYTn25sHSvcJxIFkg2LQZq3YvMQZNiqayXOtvmGyEr0aHVB9S369Dy/
[[alternative HTML version deleted]]

__
R-help@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.


[R] recoding charactor variables with special charactors

2009-07-01 Thread Chris Anderson
I have a several character variables that I need to recode, but some of them 
have special characters like single quote or ( ). How tell R to ignore these 
special characters so I can rename them? Below is the error message I am 
getting.
 
social$FamilySupport[social$FamilySupport==Mr. XXXs' extended family live in 
the Nashville area where he and his wife reside.]-Highly Supportive
Warning in `[-.factor`(`*tmp*`, social$FamilySupport == Mr. XXXs' extended 
family live in the Nashville area where he and his wife reside.,  :
  invalid factor level, NAs generated



Chris Anderson
707.315.8486
www.sassydeals4u.com

Click to find deals on color printers and inks.
http://thirdpartyoffers.netzero.net/TGL2241/fc/BLSrjpYR5fJC7MeC1xbOpWpulSKIYlbNvfa8G3h7se8nrP9RvM2utx3A3bK/
[[alternative HTML version deleted]]

__
R-help@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.


[R] help with duplicates

2009-06-05 Thread Chris Anderson
I have a large dataset that contain duplicate records. How do I identify and 
remove duplicate records?


Chris Anderson
707.315.8486
www.sassydeals4u.com

Free info for small business owners.  Click here to find great products geared 
for your business.
http://thirdpartyoffers.netzero.net/TGL2241/fc/BLSrjpYWIQYSqjUJ0P8Kjx22OUKmSdbeF2JnHh5X1EZsmlucvn6niiClhHS/
[[alternative HTML version deleted]]

__
R-help@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.