[R] Simulating data

PIKAL Petr petr.pikal at precheza.cz
Mon Jun 29 10:33:57 CEST 2015


Hi

Probably quicker would be if you try sample and tell us if the result is what you want or not.

probably something like

ind<-sample(1:nrow(yourdata), 10000, replace=TRUE)
newdata<-yourdata[ind,]

Cheers
Petr

From: devazemail at gmail.com [mailto:devazemail at gmail.com] On Behalf Of deva d
Sent: Monday, June 29, 2015 9:21 AM
To: PIKAL Petr
Cc: r-help
Subject: Re: [R] Simulating data

ok. ill just paste the data here ... hope it helps ....

y

x

5721

20175

4285

44441

4327

59426

4964

75536

7899

79432

11140

125735

11843

89411

18146

124805

24712

110859

31993

178038

41217

164212

96

1823

129

3440

151

3860

243

4630

292

4550

336

4775

517

5326

617

6030

1572

8038

1628

8291

2124

6637

0

2151

0

3786

273

5263

209

7246

199

7740

326

7830

410

9146

1171

11895

2219

12332

0

12804

0

5797

179

1046

128

2475

0

2973

0

4711

0

4562

190

4589

373

3920

783

4494

1311

5806

1658

5097

2098

4549

0

2340

0

2273

0

6821

338

6590

449

7630

394

7187

1002

2760

1251

5086

1567

11501

2034

10865

4064

2137

257

1962

235

3716

187

4018

247

5763

326

3507

407

4465

571

5860

745

7583

2741

9302

2407

12138

4932

1921

378

2798

351

5809

338

7997

570

12142

619

8430

846

9081

1238

12803

1747

22020

2232

17520

5892

18345

6021

8517

295

1373

150

4631

153

4584

244

5789

202

6349

201

9901

400

11974

795

15322

1287

11788

2742

15150

2832

9271

1078

253

663

7800

550

16511

774

23709

1002

23080

1002

36550

1671

31784

1897

53641

3443

58701

6844

40808

6834

68820

1204

3223

757

9673

709

9645

947

19942

1365

28360

2100

29433

4162

25581

2908

44605

5401

35737

7380

40534

8811

81366

221

2223

223

1330

275

3408

309

6450

252

6366

369

5005

876

6024

699

6566

876

9179

808

19411

2589

13450

1890

7967

1319

11983

1405

19004

1272

19080

1426

8732

2378

30981

3266

31115

3508

41934

4590

21222

5819

9687

8444

58891

794

552

788

4473

732

10206

807

14312

665

21202

873

12486

1033

19900

1409

24342

6849

17787

5125

24423

7569

5379

227

1861

185

4657

214

5416

269

5987

173

9236

236

9327

477

14690

813

23648

1203

13619

1797

18248

3556

18370

459

976

264

1897

334

2923

534

4072

416

4721

676

5854

630

6584

759

9366

722

11864

1120

9089

2420

11773

76

3074

187

38015

1883

7326

931

9732

954

19742

637

21232

1483

34757

1987

18896

2560

23474

2740

15734

5706

1380

222

1851

228

4254

192

4105

172

6573

444

10781

229

11558

586

10750

954

13104

1880

15074

2893

15319

2832

16566

492

2848

508

4910

476

9551

707

12304

665

13342

2262

14483

3127

4114

2169

32834

3185

28891

5601

19640

6902

15524

527

4004

1878

5618

373

8278

379

10561

580

10427

496

13935

1133

14989

1556

12419

3898

16069

3213

16977

4027

10125

1044

6997

719

13188

903

14215

2061

21969

1953

22905

1731

35201

2838

31898

4337

55505

6672

51668

8647

15021

10810

40473

0

138

0

292

108

2613

76

2786

106

6622

142

6272

208

8024

383

9999

551

3514

1094

5279

1620

5808

428

4342

399

6082

554

9737

740

15204

1265

12381

961

17481

1492

8874

1593

16376

3156

16838

2142

23949

3695

26343

578

4703

598

7029

548

9722

1004

9611

1035

8093

667

13722

1109

13701

2730

16566

2401

16469

5162

12743

3962

21301

678

3407

510

11183

753

13275

750

9006

763

11880

1177

22267

1785

22781

2924

31671

3760

26896

3974

30220

5479

21002

0

612

0

3426

0

4133

406

6634

326

5702

811

7535

980

6936

984

11172

1964

9541

2485

5865

8007

-3141

274

3161

323

3290

384

2328

398

7560

407

7466

667

3778

1208

6054

1362

7197

2057

9185

1601

11862

2174

11738

0

428

0

391

43

406

38

318

38

301

63

370

53

783

108

1753

100

1444

171

1188

390

-144

0

335

0

466

39

537

39

780

59

1208

86

1108

108

1188

121

2422

144

2882

223

3109

456

851

41

58

15

272

25

184

26

243

16

265

37

1094

52

1810

41

4059

92

-307

505

-981

488

159

218

1483

191

1122

159

2914

182

3163

262

4006

575

3487

747

4558

876

5003

695

5803

807

6341

523

-661

163

1325

216

2144

228

1151

204

1745

197

2673

332

2107

410

1751

236

5095

173

5119

194

3051

335

4057

143

1274

150

2232

158

2966

274

2597

228

1803

402

2048

189

2127

289

3136

315

6884

455

6123

411

7184

132

768

52

1620

58

1504

130

1761

138

1289

162

968

300

2626

324

2912

378

3373

413

4487

654

3138

48

679

52

597

52

936

53

1485

77

2381

82

988

121

3037

54

4367

174

6135

201

5531

148

4512



....

Deva
F-13
iResearch at NITIE
my 'research engine'

...............

in search of knowledge, everyday something is added ....
in search of wisdom, everyday something is dropped  ... an old Chinese Proverb

:::::::::::::::::::::::::

On Mon, Jun 29, 2015 at 12:38 PM, PIKAL Petr <petr.pikal at precheza.cz<mailto:petr.pikal at precheza.cz>> wrote:
Hi

Attachments are usually discarded.

maybe ?sample

Petr



> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org<mailto:r-help-bounces at r-project.org>] On Behalf Of deva d
> Sent: Monday, June 29, 2015 8:36 AM
> To: r-help
> Subject: [R] Simulating data
>
> i wish to simulate data to generate twice the sample size for testing a
> model.
>
> the two fields to be simulated are y and x, in the attached file.
>
> as you will see, these represent data of several companies, of
> different sizes, for a 11 year period. the distribution is not really
> fitting into any known or close approximation thereto.
>
> is it possible for R to simulate additional 1000 points s.t. the
> resultant distribution closely matches the distribution of the original
> data.
>
> kindly advise.
>
> thanks and best,
> *....*
>
> *Deva*
> ______________________________________________
> R-help at r-project.org<mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see
> 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.

________________________________



________________________________
Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system.
If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient.

	[[alternative HTML version deleted]]



More information about the R-help mailing list