search for: dftest

Displaying 10 results from an estimated 10 matches for "dftest".

Did you mean: ftest
2011 May 10
1
Filtering out bad data points
Hi, I always have a question about how to do this best in R. I have a data frame and a set of criteria to filter points out. My procedure is to always locate indices of those points, check if index vector length is greater than 0 or not and then remove them. Meaning dftest <- data.frame(x=rnorm(100),y=rnorm(100)); qtile <- quantile(dftest$x,probs=c(0.05,0.95)); badIdx <- which((dftest$x < qtile[1]) | (dftest$x > qtile[2])); if (length(badIdx) > 0) { dftest <- dftest[-idx,]; } My question is that is there a more streamlined way to achieve thi...
2011 Oct 25
2
Logistic Regression - Variable Selection Methods With Prediction
...orward, Backward, All possible subsests. I am using misclassification rate to pick the winner method. This is what i have as of now, Reg <- glm (Graduation ~., DFtrain,family=binomial(link="logit")) step <- extractAIC(Reg, direction="forward") pred <- predict(Reg, DFtest,type="response") mis <- mean({pred > 0.5} != {DFtest[,"Graduation"] == "Y"}) This program actually works but I needed to check to make sure am doing this right. Also, I am getting the same misclassification rates for all different methods. I also tried to use...
2012 May 01
3
Data frame vs matrix quirk: Hinky error message?
AdvisoRs: Is the following a bug, feature, hinky error message, or dumb Bert? > mtest <- matrix(1:12,nr=4) > dftest <- data.frame(mtest) > ix <- cbind(1:2,2:3) > mtest[ix] <- NA > mtest [,1] [,2] [,3] [1,] 1 NA 9 [2,] 2 6 NA [3,] 3 7 11 [4,] 4 8 12 ## But ... > dftest[ix] <- NA Error in `[<-.data.frame`(`*tmp*`, ix, value = NA) : only logical mat...
2012 Jan 02
2
Conditionally adding a constant
I am trying to add a constant to the previous value of a variable based on certain conditions. Maybe there is a simple way to do this that I am missing completely. I have given an example below: df <- data.frame(x = c(1,2,3,4,5), y = c(10,20,30,NA,NA)) > df x y 1 1 10 2 2 20 3 3 30 4 4 NA 5 5 NA I want to add 2 to the previous value of y, if x exceeds 3 (also will have to handle NAs in
2012 Jun 28
1
add constraints to nls or use another function
...in advance for your help, Have a good day, Ptit Bleu. ------------------------------------------------------------------------------------------------------------- #The experimental data : http://r.789695.n4.nabble.com/file/n4634705/nlstest_data.txt nlstest_data.txt #The script library(lattice) dftest<-read.table("nlstest_data.txt", sep=";", dec=".", as.is=T, header=T) nlsfit<-coefficients(nls(y ~ F+A*(x-1)+B*log(x)+C*(x-1)*(x-1)+D*log(x)*log(x), data=dftest, start = list(A=-0.06,B=0.48,C=0.89,D=0.03,F=1), control=list(maxiter=200, tol=0.01))) # Coefficients...
2008 Mar 10
2
write.table with row.names=FALSE unnecessarily slow?
write.table with large data frames takes quite a long time > system.time({ + write.table(df, '/tmp/dftest.txt', row.names=FALSE) + }, gcFirst=TRUE) user system elapsed 97.302 1.532 98.837 A reason is because dimnames is always called, causing 'anonymous' row names to be created as character vectors. Avoiding this in src/library/utils, along the lines of Index: write.table.R ====...
2012 Sep 04
0
AFTREG weights
...1 0 3 0.643382 1 > 10 1 2 0 3 0.300433 1 > 11 2 3 0 3 0.666964 1 > > with this function > > AftRegTD<-aftreg(Surv(StartTime,EndTime,Event)~Cov,dist="loglogistic",id=dfTest$IdObs,data=dfTest) > > Any suggestion to introduce "weights" as argument in aftreg function? > No, not for the moment, although it would be straightforward to add. However, I am not sure that case weights is what you are seeking. Göran > Thanks, > Francesca > --...
2004 Apr 20
0
strange result with contrasts
...-000mM -0.01972550 0.04288981 -0.4599111 6.473607e-01 dose050mM-000mM -0.12015983 0.05356935 -2.2430704 2.886726e-02 <- significant dose100mM-000mM 0.01252061 0.04113846 0.3043529 7.619872e-01 A collegue of mine has run the same data through a SAS program (listed below) proc glm data = dftest; class dose time batch; model value = dose|time|batch; means dose / dunnett ('000mM'); lsmeans dose /pdiff singular=1; run; Giving the following p-values: Pr(>|t|) dose010mM-000mM 0.4047 dose025mM-000mM 0.6474 dose050m...
2013 Jul 24
3
Change values in a dateframe
Hello I have the following problem : The dataframe TEST has multiple lines for a same person because : there are differents values of Nom or differents values of Prenom but the values of Matricule or Sexe or Date.de.naissance are the same. TEST <- structure(list(Matricule = c(66L, 67L, 67L, 68L, 89L, 90L, 90L, 91L, 108L, 108L, 108L), Nom = structure(c(1L, 2L, 2L, 4L, 8L, 5L, 6L, 9L, 3L, 3L,
2020 Jan 07
2
Network Diagnostics
In our smallest office, we have a Dell CentOS 7 system, a Windows system and an HP 8610 printer, all hard-wire Ethernet connected with a Linksys router. The router provides Internet connection. All of the network-connected systems get their IP address from the router at power up. Successful network connection of the printer at power up has recently started taking much longer than usual.? The