Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6896979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:06:42+00:00 2026-05-27T07:06:42+00:00

I would like to write a code to generate a dataset censored with 1

  • 0

I would like to write a code to generate a dataset censored with 1 censored data point and varying percent censored.
I have the following code to generate some random numbers but not censored

n=input('Enter sample size:');
GM=input('Enter geometric mean:'); 
GSD=input('Enter geometric standard deviation:');
m=input('Enter desired number of dataset:');
x = lognrnd(log(GM), log(GSD),n,m);

I have the following code to create a censored dataset with known a limit of detection (lod) value (LOD) and then calculate the percent censored value and there I have a dataset to work with.

c = (x > lod); % c are values less than this number 
x(c) = lod;  % create single lod
sum(c)/length(c) % calculate percent censored

but what I want to do it is to provide the computer the desired percent censored and have the computer find the lod corresponds to that percent censored. I can manually put in the lod value but that takes very long time if i want to create a dataset with percent censored 5-95.

The goal is to create varying censored datasets with varying percent censored for a simulation. I’ve been doing it one dataset at a time and it’s taking a very long time. Please let me know if this all makes sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:06:43+00:00Added an answer on May 27, 2026 at 7:06 am

    If you have Statistical Toolbox you can use functions PRCTILE:

    pct = 10;
    lod = prctile(x, pct);
    

    or QUANTILE (it actually uses prctile inside).

    pct = 0.1;
    lod = quantile(x,pct);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write some LINQ To SQL code that would generate SQL like
I have a quad core machine and would like to write some code to
I'd like to write a function that would have some optional code to be
I would like to write some Objective-C code for distribution. What is the best
I would like to write some data to a file in Ruby. What is
I would like to write a gas macro to generate code containing various movdqu
Would having a nice little feature that makes it quicker to write code like
Can .NET (managed code) read and write to CouchDB? I would like to build
I would like a function that can generate a pseudo-random sequence of values, but
I would like to know how I could generate code from a text file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.