Home » date » 2009 » Nov » 24 »

*Unverified author*
R Software Module: /rwasp_rngnorm.wasp (opens new window with default values)
Title produced by software: Random Number Generator - Normal Distribution
Date of computation: Tue, 24 Nov 2009 08:11:02 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Nov/24/t125907598894pi3rfpjjr1zpe.htm/, Retrieved Tue, 24 Nov 2009 16:19:50 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2009/Nov/24/t125907598894pi3rfpjjr1zpe.htm/},
    year = {2009},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2009},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Output produced by software:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


IndexValue
13.08463886829913
22.80726554547746
30.114044091346210
4-0.81405728653962
50.816518356233993
60.943145974612407
71.42576657412021
82.76064479291249
90.156248958360458
100.288537015818088
110.332018553971477
121.32824023563145
131.60804656997443
141.33535464186342
150.815744077764173
160.856179647511435
17-0.22305081657726
18-0.861236953747741
190.424647639692915
200.106186162060778
21-1.36540247027832
221.81921113555646
230.262901840419590
240.96111405367641
250.907791003831522
260.883295783031652
27-1.14344218100283
28-0.622150340976821
29-0.0522871750036843
30-0.115567296488522
312.27864820769805
321.36747365039917
331.02427300454456
34-0.385494722615087
35-0.691606289260516
361.37668767952335
370.442133945495995
381.76231970313877
391.39186582823445
40-0.0744549700035901
410.64612019218244
420.917512057320635
431.10724713840974
440.89780352137157
451.31124056998547
460.00847882921295656
47-1.79196158908482
48-0.130970687417289
49-1.56397888993473
501.43527634656848
510.880850546200246
52-0.0359214795861228
531.62658039403832
540.844822283430924
550.910490955520153
561.61897404438883
570.908099361373333
580.334134432255144
590.993957711034347
600.369082596148573
611.62650533499320
62-0.179569316153506
63-1.79811643929669
64-0.451389441648966
651.27814656949639
661.96218815612436
67-0.92582999591374
680.61284765730582
690.939975498547774
700.0993385146257036
71-0.661923644394036
720.616605658173596
73-0.511352365239278
740.809327178903487
752.24946881586332
760.606154718128834
770.891642783075003
780.0284726559920365
79-0.791893842813785
801.15787211784735
810.236469596335202
820.198123389774107
832.48136548060165
84-0.228414219764124
851.57602972035046
860.432870829415921
870.459074476491824
88-1.01994772703155
891.66739133409574
90-0.73425042317419
911.27256629427744
92-1.00134585393971
93-0.577836991265543
940.444929145209171
95-1.59477350045536
96-0.289805937117300
97-1.07310728652043
980.405048888614146
990.473042916184886
1000.0560494303142088


ParameterValueStandard Deviation
# simulated values100-
true mean0.5-
true standard deviation1-
mean0.4936198154813820.102917672375425
standard deviation1.029176723754250.0727737840405983
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Nov/24/t125907598894pi3rfpjjr1zpe/1lsn21259075460.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/24/t125907598894pi3rfpjjr1zpe/1lsn21259075460.ps (open in new window)


 
Parameters (Session):
par1 = 100 ; par2 = .5 ; par3 = 1 ; par4 = 2 ; par5 = Y ; par6 = 0 ;
 
Parameters (R input):
par1 = 100 ; par2 = .5 ; par3 = 1 ; par4 = 2 ; par5 = Y ; par6 = 0 ;
 
R code (references can be found in the software module):
library(MASS)
library(msm)
par1 <- as.numeric(par1)
if (par1 > 10000) par1=10000 #impose restriction on number of random values
par2 <- as.numeric(par2)
par3 <- as.numeric(par3)
par4 <- as.numeric(par4)
if (par6 == '0') par6 = 'Sturges' else {
par6 <- as.numeric(par6)
if (par6 > 50) par6 = 50 #impose restriction on the number of bins
}
if (par7 == '') par7 <- -Inf else par7 <- as.numeric(par7)
if (par8 == '') par8 <- Inf else par8 <- as.numeric(par8)
x <- rtnorm(par1,par2,par3,par7,par8)
x <- as.ts(x) #otherwise the fitdistr function does not work properly
if ((par7 == -Inf) & (par8 == Inf)) (r <- fitdistr(x,'normal'))
bitmap(file='test1.png')
myhist<-hist(x,col=par4,breaks=par6,main=main,ylab=ylab,xlab=xlab,freq=F)
if ((par7 == -Inf) & (par8 == Inf)) {
curve(1/(r$estimate[2]*sqrt(2*pi))*exp(-1/2*((x-r$estimate[1])/r$estimate[2])^2),min(x),max(x),add=T)
}
dev.off()
load(file='createtable')
if (par5 == 'Y')
{
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Index',1,TRUE)
a<-table.element(a,'Value',1,TRUE)
a<-table.row.end(a)
for (i in 1:par1)
{
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
}
if ((par7 == -Inf) & (par8 == Inf)) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Parameter',1,TRUE)
a<-table.element(a,'Value',1,TRUE)
a<-table.element(a,'Standard Deviation',1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'# simulated values',header=TRUE)
a<-table.element(a,par1)
a<-table.element(a,'-')
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'true mean',header=TRUE)
a<-table.element(a,par2)
a<-table.element(a,'-')
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'true standard deviation',header=TRUE)
a<-table.element(a,par3)
a<-table.element(a,'-')
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'mean',header=TRUE)
a<-table.element(a,r$estimate[1])
a<-table.element(a,r$sd[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'standard deviation',header=TRUE)
a<-table.element(a,r$estimate[2])
a<-table.element(a,r$sd[2])
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by