0

I've been running a variation of the doseResponse function downloaded from here to generate dose-response sigmoid curves. However, I've had trouble with one of my datasets that keeps generating a small EC50 value that visually doesn't appear to be correct. By running the following code, I get an EC50 value of .0014, but I feel that it should be much higher. I uploaded the data here. Does anyone know what I can do to fix this? Thanks.

Code to generate graph

    % Plotting Dose-Response Curve
% Deal with 0 dosage by using it to normalise the results.
normalised=0;
if (sum(dose(:)==0)>0)
    %compute mean control response
    controlResponse=mean(response(dose==0));
    %remove controls from dose/response curve
    response=response(dose~=0)/controlResponse;
    dose=dose(dose~=0);
    normalised=1;
end

%hill equation sigmoid
sigmoid=@(beta,x)beta(1)+(beta(2)-beta(1))./(1+(x/beta(3)).^beta(4));

%calculate some rough guesses for initial parameters
minResponse=min(response);
maxResponse=max(response);
midResponse=mean([minResponse maxResponse]);
minDose=min(dose);
maxDose=max(dose);

% options=optimset('disp','iter','LargeScale','off','TolFun',.001,'MaxIter',1e10,'MaxFunEvals',1e10);

%fit the curve and compute the values
beta_new = lsqcurvefit(sigmoid,[minResponse maxResponse midResponse 1.5],dose,response);
[coeffs,r,J]=nlinfit(dose,response,sigmoid,beta_new);

ec50=coeffs(3);
hillCoeff=coeffs(4);

%plot the fitted sigmoid
xpoints=logspace(log10(minDose),log10(maxDose),1000);
semilogx(xpoints,sigmoid(coeffs,xpoints),'Color',[0 0 0],'LineWidth',2)
ax = gca; 
ax.FontSize = 22.5; 
hold on

%notate the EC50
text(ec50,mean([coeffs(1) coeffs(2)]),[' \leftarrow ' sprintf('EC_{50}=%0.2g',ec50)],'FontSize',22.5,'Color',[0 0 0]);

%plot mean response for each dose with standard error
doses=unique(dose);
meanResponse=zeros(1,length(doses));
stdErrResponse=zeros(1,length(doses));
for i=1:length(doses)
    responses=response(dose==doses(i));
    meanResponse(i)=mean(responses);
    stdErrResponse(i)=std(responses)/sqrt(length(responses));
    %stdErrResponse(i)=std(responses);
end

errorbar(doses,meanResponse,stdErrResponse,'o','Color',[0 0 0],'LineWidth',2,'MarkerSize',12)

Picture of Graph enter image description here

0 Answers0