[R] ifelse command

2010-08-18 Thread Philip Wong
hello people, I want to make a biased dice using the sample() function and print out the results after n number of runs, I've successfully generated the dice using the following command: mydie2-function(n=1000,y=NULL,...){ for(i in 1:n){ x-sample(1:6,n,replace=TRUE,prob=c(1,1,2,3,2,1)/10)

Re: [R] ifelse command

2010-08-18 Thread Philip Wong
well to be honest, it is a assignment for the Bayesian statistic paper I wish to take later in the academic year. But I'm a slow learner, so I'm going to try out some of the assignments posted in the university forum hoping to get some practice in advance. Could you please elaborate more on the

Re: [R] ifelse command

2010-08-18 Thread Philip Wong
Hi Josh, I think I know where does the 50+ warning is coming from, because I used n in runif(n), similarly I get 50+ warnings if I use runif(1000). Yet if I use runif(1) the warnings() doesn't show. -- View this message in context:

Re: [R] ifelse command

2010-08-18 Thread Philip Wong
Hi Dennis, I see your point about using a different name for the runif() functions, other then the one I used to stimulate the bias coins. I start to get what you and David meant after thinking it through for a while regarding with comparison the biased dice and the uniform distribution, but the

[R] what command to use for standization

2010-05-29 Thread Philip Wong
what command to use to standardize my data to mean = 0, and SD=1. the data I want to standardize/centroid is in column format. So I'm thinking of using: col.mean.stdised=apply(data.df,2,function(z){z-mean(z)}) but, what command should I use to put my SD =1? Thanks! -- View this message in

[R] Scree diagram,

2010-05-01 Thread Philip Wong
hello, I've two questions today. 1) I'm trying to do a scree diagram, I did a Google for a specific command I could used to do so. All I could find is a screeplot. Are they the same command? 2) what command can I used to present a PC scores, eigenvectors of the PC scores, and component

[R] how can I stop getting email from every comment posted in this forum?

2010-04-07 Thread Philip Wong
hello people, I didn't know where should post this thread, I asked Hugo the nabble administrator and his response was I should be able to unsubscribed from getting an email from every comment or response posted here. Yet I couldn't find the method nor the button to click to do so. I even change

[R] producing a QQ plot.

2010-03-27 Thread Philip Wong
Hello everyone I'm a beginner in Stats and R, I'm using R 2.10.1. I need to create a multivariate qq plot, there is 8 variable group with each has 55 number of input. An example of what I did so far, just to get my point out: data=read.csv(file.choose(),header=T) data country

Re: [R] producing a QQ plot.

2010-03-27 Thread Philip Wong
Hello, this is the first 10 data of the population. country village group av_expenP2ary_edno_fisher B_Leth B_LutjanWt_Leth Wt_Lutjan Cook IslandsAitutakiD 5239.127472 0.7 666.9998558 3.286283997 1.971519001 520.6454552

Re: [R] producing a QQ plot.

2010-03-27 Thread Philip Wong
Aha! I see now! thanks guys! really helpful! -- View this message in context: http://n4.nabble.com/producing-a-QQ-plot-tp1693228p1693259.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Problems faced with Levene Test using R

2010-03-27 Thread Philip Wong
Hello everyone, I'm trying to build Levene's test. The below command is what I used to do the test, I also included the error it prompts up and some data example that I used when trying to build the test. Can someone please tell me what did I do wrong? thanks in advance!