Peter,
I found it. There is a missing value under column SubID. I filled it out
with an ID number, and the error message never occur again. Although I found
the problem, I have no idea why would this be associated with such an error
message. If anybody else have some input, I would really appreci
I tried it several times. it still gives me the same error.
I also used traceback()
here is what I got:
> traceback()
3: `[.data.frame`(df, -s1$SubID, )
2: df[-s1$SubID, ]
1: crossed1(agr)
But I don't think there is anything wrong with it..
--
View this message in context:
http://r.78969
I was running a sampling syntax based on a data frame (ago) of 160 rows and
25 columns. Below are the column names:
> names(ago)
[1] "SubID" "AGR1" "AGR2" "AGR3" "AGR4" "AGR5" "AGR6" "AGR7"
"AGR8"
[10] "AGR9" "AGR10" "WAGR1" "WAGR2" "WAGR3" "WAGR4" "WAGR5" "WAGR6"
"WAGR
I have a really simple question
I have a data frame of 8 variables (the first column is the subjects' id):
SubID G1G2 G3 G4W1W2 W3W4
1 6 5 6 2 6 22 4
2 6 4 7 2 6
I am too negligent... thank you very much for pointing out that!
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-run-linear-regression-models-at-once-tp3179256p3207823.html
Sent from the R help mailing list archive at Nabble.com.
___
hey, Dennis,
I applied your syntax into my data frame with different variable names.
Specifically, I replaced y1 and y2, with ocbi and ocbo. I got the following
error message. Could you please explain why would this happen? Again,
thanks!
> for(i in 1:5){fm1<-as.formula(paste('ocbi',ms[i],sep='
cool, it worked. thank you very much for your help!! :)
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-run-linear-regression-models-at-once-tp3179256p3205186.html
Sent from the R help mailing list archive at Nabble.com.
__
R-hel
hey, folks,
I have two very simple questions. I am not quite sure if I can do this using
R.
so, I am analyzing a large data frame with thousands of variables. For
example:
Dependent variables: d1, d2, d3 (i.e., there are three dependent variables)
Independent variables: s1, s2, s3, ..s100
I tried it. it works out perfectly. you save my life.
--
View this message in context:
http://r.789695.n4.nabble.com/Re-how-to-apply-sample-function-to-each-row-of-a-data-frame-tp3050933p3054117.html
Sent from the R help mailing list archive at Nabble.com.
__
Hey, PS,
I revised your syntax and used it to another one of my data frames (df).
here is the data frame:
a b c A B C
[1,] 1 2 3 4 5 6
[2,] 7 8 9 10 11 12
[3,] 13 14 15 16 17 18
a, b, c are type I variables
A, B, C are type II variables
each row represent the data
Gong, thanks!! but your syntax did work out as I would expect. here following
are the reasons:
each row from my original data frame represents data from one subject. when
the one type I number and the
two type II numbers are drawn from the original data frame, both type I
number and type II numb
here is my original data frame
a b c A B C
[1,] 1 2 3 4 5 6
[2,] 7 8 9 10 11 12
[3,] 13 14 15 16 17 18
a, b, c are type I variables
A, B, C are type II variables
how can I create a new data frame in which:
1) in each row, there are one random number from type I var
it works. I really appreciate the help! :)
--
View this message in context:
http://r.789695.n4.nabble.com/Re-how-to-apply-sample-function-to-each-row-of-a-data-frame-tp3050933p3052098.html
Sent from the R help mailing list archive at Nabble.com.
__
R-
> this is a simple question, but I wasn't able to figure it out myself.
>
> here is the data frame:
>
> M P Q
> 1 2 3
> 4 5 6
> 7 8 9
>
> M, P, Q each represent a variable
>
> I want to draw 2 random sample from each row separately to create a new
> data frame. how can I do it?
>
> thanks!!
sor
this is a simple question, but I wasn't able to figure it out myself.
here is the data frame:
M P Q
1 2 3
4 5 6
7 8 9
M, P, Q each represent a variable
I want to draw 2 random sample from each row separately to create a new data
frame. how can I do it?
thanks!!
--
View this message in conte
I spent the whole afternoon on it, but there is still no progress. I wish I
could take some courses... :(
--
View this message in context:
http://r.789695.n4.nabble.com/New-Sampling-question-tp3047885p3049796.html
Sent from the R help mailing list archive at Nabble.com.
___
Hi, Mike,
thank you very much!!:)
the following two functions are really helpful, which I didn't even know.
Actually, I searched the forum for something like this, but failed. Now I am
still trying to make up my own functions. :)
sample(a[,2],2) #randomly draw two numbers from a column
sample(
I tried. yours works too. thanks a bounch!! Man
--
View this message in context:
http://r.789695.n4.nabble.com/Sampling-problem-tp3043804p3049013.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https:
Also, I need some function at the end which would enable me to draw 1000 such
random samples. thanks! :)
--
View this message in context:
http://r.789695.n4.nabble.com/New-Sampling-question-tp3047885p3048958.html
Sent from the R help mailing list archive at Nabble.com.
_
Dear Ista Zahn-2,
If you can give me some advice, I really appreciate it. I have been working
on it for days. it seems hard for some novice of R like me to write flexible
functions myself.
This is for my dissertation. CSE and WSE are two scales of the same
construct. The sampling strategy I wan
I have another question about drawing samples from a data frame. This might
sound really tricky. Let me use a data frame I have posted earlier as an
example:
SubIDCSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4
1 6 5 6 2 6 22 4
2
I figured it out myself.
Again, Michael and Petr, many thanks to both of you!!! :)
--
View this message in context:
http://r.789695.n4.nabble.com/Sampling-problem-tp3043804p3046161.html
Sent from the R help mailing list archive at Nabble.com.
__
R-h
Fabulicious! It worked!!!
One more question, in the following data frame as posted above:
SubIDCSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4
1 6 5 6 2 6 22 4
2 6 4 7 2 6 6
yes, the data.frame is exactly the same as the one I posted earlier.
I was trying to see if the loop function works. And I got that message. here
below is the syntax I was trying to run, followed by the error message at
the end:
> sampleX<-function(X,nGrp1,nsamples){if(nGrp1>=4)stop("can't sampl
Michael, I really appreciate your help.
but I got the following error message when I wan trying to run the function
written by you:
Error in out[i, ] <- apply(help[, c(grp1 + 1, grp2 + 5)], 2, sample, 1) :
number of items to replace is not a multiple of replacement length
I am not quite sure
Hey,
I am hoping someone can help me with a sampling question.
I have a data frame of 8 variables (the first column is the subjects' id):
SubIDCSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4
1 6 5 6 2 6 22 4
2 6 4
26 matches
Mail list logo